Skip to content

CSI sanity test failure for ControllerExpand due to missing 'secrets' in the ControllerExpandVolumeRequest #215

@suneeth51

Description

@suneeth51

We have implemented CSI driver plugin as per the SPEC. A few sanity tests (i.e, ControllerExpandVolume) failed with our CSI driver due to missing or empty secrets provided in the ‘ControllerExpandVolumeRequest’. Our CSI driver does check for valid secrets to talk to the backend storage for that particular volume.

I do see that the secrets are specified (though its optional in the SPEC) for other workflows like createVolume, deleteVolume, publishVolume, etc.., why are they missing in the ControllerExpandVolumeRequest? Is it a bug or left out intentionally?

--------------- SANITY CODE SNIPPET -------------------------------
Reference: https://github.com/kubernetes-csi/csi-test/blob/master/pkg/sanity/controller.go

2123 It("should work", func() {
2124
2125 By("creating a new volume")
2126 name := UniqueString("sanity-expand-volume")
2127
2128 // Create a new volume.
2129 req := &csi.CreateVolumeRequest{
2130 Name: name,
2131 VolumeCapabilities: []*csi.VolumeCapability{
2132 {
2133 AccessType: &csi.VolumeCapability_Mount{
2134 Mount: &csi.VolumeCapability_MountVolume{},
2135 },
2136 AccessMode: &csi.VolumeCapability_AccessMode{
2137 Mode: csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER,
2138 },
2139 },
2140 },
2141 Secrets: sc.Secrets.CreateVolumeSecret,
2142 CapacityRange: &csi.CapacityRange{
2143 RequiredBytes: TestVolumeSize(sc),
2144 },
2145 }
2146
2147 vol, err := c.CreateVolume(context.Background(), req)
2148 Expect(err).NotTo(HaveOccurred())
2149 Expect(vol).NotTo(BeNil())
2150 Expect(vol.GetVolume()).NotTo(BeNil())
2151 Expect(vol.GetVolume().GetVolumeId()).NotTo(BeEmpty())
2152 cl.RegisterVolume(name, VolumeInfo{VolumeID: vol.GetVolume().GetVolumeId()})
2153 By("expanding the volume")
2154 expReq := &csi.ControllerExpandVolumeRequest{
2155 VolumeId: vol.GetVolume().GetVolumeId(),
2156 CapacityRange: &csi.CapacityRange{
2157 RequiredBytes: TestVolumeExpandSize(sc),
2158 },
2159 }

2160 rsp, err := c.ControllerExpandVolume(context.Background(), expReq)
2161 Expect(err).NotTo(HaveOccurred())
2162 Expect(rsp).NotTo(BeNil())
2163 Expect(rsp.GetCapacityBytes()).To(Equal(TestVolumeExpandSize(sc)))

------------------------------ CSI TEST LOG SNIPPET --------------------------------
••••STEP: reusing connection to CSI driver at unix:///tmp/csi.sock
STEP: creating mount and staging directories
STEP: creating a new volume
STEP: expanding the volume
cleanup: deleting sanity-expand-volume-FFC5A02E-C9CD54A9 = sanity-expand-volume-FFC5A02E-C9CD54A9


• Failure [0.039 seconds]
ExpandVolume [Controller Server]
/Users/sbyadarahalli/go_code/GOPATH/pkg/mod/github.com/kubernetes-csi/csi-test@v2.2.0+incompatible/pkg/sanity/tests.go:44
should work [It]
/Users/sbyadarahalli/go_code/GOPATH/pkg/mod/github.com/kubernetes-csi/csi-test@v2.2.0+incompatible/pkg/sanity/controller.go:2123

Unexpected error:
<*status.statusError | 0xc0001b8eb0>: {
Code: 13,
Message: "Failed to get storage provider from secrets, err: No secrets have been provided",
Details: nil,
XXX_NoUnkeyedLiteral: {},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
rpc error: code = Internal desc = Failed to get storage provider from secrets, err: No secrets have been provided
occurred

/Users/sbyadarahalli/go_code/GOPATH/pkg/mod/github.com/kubernetes-csi/csi-test@v2.2.0+incompatible/pkg/sanity/controller.go:2161

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions