diff --git a/test/e2e/storage/csi_mock/base.go b/test/e2e/storage/csi_mock/base.go index c822509ed29..4dc451d6e84 100644 --- a/test/e2e/storage/csi_mock/base.go +++ b/test/e2e/storage/csi_mock/base.go @@ -836,8 +836,8 @@ func compareCSICalls(ctx context.Context, trackedCalls []string, expectedCallSeq // if the secret is not nil, compare it if expectedCall.expectedSecret != nil { - if !reflect.DeepEqual(expectedCall.expectedSecret, c.Request.Secret) { - return allCalls, i, fmt.Errorf("Unexpected secret: expected %v, got %v", expectedCall.expectedSecret, c.Request.Secret) + if !reflect.DeepEqual(expectedCall.expectedSecret, c.Request.Secrets) { + return allCalls, i, fmt.Errorf("Unexpected secret: expected %v, got %v", expectedCall.expectedSecret, c.Request.Secrets) } } diff --git a/test/e2e/storage/csi_mock/csi_volume_expansion.go b/test/e2e/storage/csi_mock/csi_volume_expansion.go index 298197bfe8e..cbc840f098d 100644 --- a/test/e2e/storage/csi_mock/csi_volume_expansion.go +++ b/test/e2e/storage/csi_mock/csi_volume_expansion.go @@ -201,7 +201,7 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() { }) } }) - ginkgo.Context("CSI online volume expansion with secret[Feature:CSINodeExpandSecret]", func() { + ginkgo.Context("CSI online volume expansion with secret", func() { var stringSecret = map[string]string{ "username": "admin", "password": "t0p-Secret", @@ -274,6 +274,11 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() { err = e2epod.WaitForPodNameRunningInNamespace(ctx, m.cs, pod.Name, pod.Namespace) framework.ExpectNoError(err, "Failed to start pod1: %v", err) + pvc, err = m.cs.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(ctx, pvc.Name, metav1.GetOptions{}) + if err != nil { + framework.Failf("failed to get pvc %s, %v", pvc.Name, err) + } + gomega.Expect(pvc.Spec.VolumeName).ShouldNot(gomega.BeEquivalentTo(""), "while provisioning a volume for resizing") pv, err := m.cs.CoreV1().PersistentVolumes().Get(ctx, pvc.Spec.VolumeName, metav1.GetOptions{}) if err != nil { framework.Failf("failed to get pv %s, %v", pvc.Spec.VolumeName, err) @@ -281,6 +286,9 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() { if pv.Spec.CSI == nil || pv.Spec.CSI.NodeExpandSecretRef == nil { framework.Fail("creating pv without 'NodeExpandSecretRef'") } + if pv.Spec.CSI.NodeExpandSecretRef.Namespace != f.Namespace.Name || pv.Spec.CSI.NodeExpandSecretRef.Name != secretName { + framework.Failf("failed to set node expand secret ref, namespace: %s name: %s", pv.Spec.CSI.NodeExpandSecretRef.Namespace, pv.Spec.CSI.NodeExpandSecretRef.Name) + } ginkgo.By("Expanding current pvc") newSize := resource.MustParse("6Gi") @@ -298,9 +306,14 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() { err = testsuites.WaitForControllerVolumeResize(ctx, pvc, m.cs, csiResizeWaitPeriod) framework.ExpectNoError(err, "While waiting for PV resize to finish") + ginkgo.By("Waiting for PVC resize to finish") + pvc, err = testsuites.WaitForFSResize(ctx, pvc, m.cs) + framework.ExpectNoError(err, "while waiting for PVC to finish") + ginkgo.By("Waiting for all remaining expected CSI calls") err = wait.Poll(time.Second, csiResizeWaitPeriod, func() (done bool, err error) { - _, index, err := compareCSICalls(ctx, trackedCalls, test.expectedCalls, m.driver.GetCalls) + var index int + _, index, err = compareCSICalls(ctx, trackedCalls, test.expectedCalls, m.driver.GetCalls) if err != nil { return true, err } @@ -316,10 +329,6 @@ var _ = utils.SIGDescribe("CSI Mock volume expansion", func() { }) framework.ExpectNoError(err, "while waiting for all CSI calls") - ginkgo.By("Waiting for PVC resize to finish") - pvc, err = testsuites.WaitForFSResize(ctx, pvc, m.cs) - framework.ExpectNoError(err, "while waiting for PVC to finish") - pvcConditions := pvc.Status.Conditions framework.ExpectEqual(len(pvcConditions), 0, "pvc should not have conditions") }) diff --git a/test/e2e/storage/drivers/csi.go b/test/e2e/storage/drivers/csi.go index b41c485e843..09548a1c2f4 100644 --- a/test/e2e/storage/drivers/csi.go +++ b/test/e2e/storage/drivers/csi.go @@ -379,7 +379,7 @@ type MockCSICall struct { Method string Request struct { VolumeContext map[string]string `json:"volume_context"` - Secret map[string]string `json:"secret"` + Secrets map[string]string `json:"secrets"` } FullError struct { Code codes.Code `json:"code"` diff --git a/test/e2e/testing-manifests/storage-csi/gce-pd/controller_ss.yaml b/test/e2e/testing-manifests/storage-csi/gce-pd/controller_ss.yaml index 0ca5a187f33..e6be99ae536 100644 --- a/test/e2e/testing-manifests/storage-csi/gce-pd/controller_ss.yaml +++ b/test/e2e/testing-manifests/storage-csi/gce-pd/controller_ss.yaml @@ -39,7 +39,7 @@ spec: - name: socket-dir mountPath: /csi - name: csi-provisioner - image: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0 + image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0 args: - "--v=5" - "--csi-address=/csi/csi.sock" diff --git a/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml b/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml index 33cf06a9a5e..6a41a023913 100644 --- a/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml +++ b/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml @@ -323,7 +323,7 @@ spec: name: socket-dir - name: csi-provisioner - image: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0 + image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0 args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml b/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml index 29570e39f17..4493deccc09 100644 --- a/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml +++ b/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: csi-mock containers: - name: csi-provisioner - image: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0 + image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0 args: - "--csi-address=$(ADDRESS)" # Topology support is needed for the pod rescheduling test diff --git a/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml b/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml index ba27f936749..d1aa8ece864 100644 --- a/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml +++ b/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: csi-mock containers: - name: csi-provisioner - image: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0 + image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0 args: - "--csi-address=$(ADDRESS)" # Topology support is needed for the pod rescheduling test