From 1f2588496dafa264287b24f726caaee865974b15 Mon Sep 17 00:00:00 2001 From: David Zhu Date: Thu, 14 Nov 2019 19:29:20 -0800 Subject: [PATCH] Revert "Enable snapshot e2e test for csi pd driver" --- test/e2e/storage/drivers/csi.go | 11 ----- test/e2e/storage/testsuites/snapshottable.go | 7 ---- .../storage-csi/gce-pd/controller_ss.yaml | 12 +----- .../gce-pd/csi-controller-rbac.yaml | 42 +------------------ 4 files changed, 3 insertions(+), 69 deletions(-) diff --git a/test/e2e/storage/drivers/csi.go b/test/e2e/storage/drivers/csi.go index f0e9cd1d8c7..e146813bb12 100644 --- a/test/e2e/storage/drivers/csi.go +++ b/test/e2e/storage/drivers/csi.go @@ -352,7 +352,6 @@ type gcePDCSIDriver struct { var _ testsuites.TestDriver = &gcePDCSIDriver{} var _ testsuites.DynamicPVTestDriver = &gcePDCSIDriver{} -var _ testsuites.SnapshottableTestDriver = &gcePDCSIDriver{} // InitGcePDCSIDriver returns gcePDCSIDriver that implements TestDriver interface func InitGcePDCSIDriver() testsuites.TestDriver { @@ -384,7 +383,6 @@ func InitGcePDCSIDriver() testsuites.TestDriver { testsuites.CapTopology: true, testsuites.CapControllerExpansion: true, testsuites.CapNodeExpansion: true, - testsuites.CapSnapshotDataSource: true, }, RequiredAccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, TopologyKeys: []string{GCEPDCSIZoneTopologyKey}, @@ -420,15 +418,6 @@ func (g *gcePDCSIDriver) GetDynamicProvisionStorageClass(config *testsuites.PerT return testsuites.GetStorageClass(provisioner, parameters, &delayedBinding, ns, suffix) } -func (g *gcePDCSIDriver) GetSnapshotClass(config *testsuites.PerTestConfig) *unstructured.Unstructured { - parameters := map[string]string{} - snapshotter := g.driverInfo.Name - ns := config.Framework.Namespace.Name - suffix := fmt.Sprintf("%s-vsc", snapshotter) - - return testsuites.GetSnapshotClass(snapshotter, parameters, ns, suffix) -} - func (g *gcePDCSIDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConfig, func()) { ginkgo.By("deploying csi gce-pd driver") cancelLogging := testsuites.StartPodLogs(f) diff --git a/test/e2e/storage/testsuites/snapshottable.go b/test/e2e/storage/testsuites/snapshottable.go index 7fc7cf627b0..db57e7948ab 100644 --- a/test/e2e/storage/testsuites/snapshottable.go +++ b/test/e2e/storage/testsuites/snapshottable.go @@ -28,7 +28,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" "k8s.io/kubernetes/test/e2e/framework" - e2epod "k8s.io/kubernetes/test/e2e/framework/pod" e2epv "k8s.io/kubernetes/test/e2e/framework/pv" "k8s.io/kubernetes/test/e2e/framework/volume" "k8s.io/kubernetes/test/e2e/storage/testpatterns" @@ -147,12 +146,6 @@ func (s *snapshottableTestSuite) defineTests(driver TestDriver, pattern testpatt framework.Failf("Error deleting claim %q. Error: %v", pvc.Name, err) } }() - - ginkgo.By("starting a pod") - command := fmt.Sprintf("grep '%s' /mnt/test/initialData", pvc.Namespace) - pod := StartInPodWithVolume(cs, pvc.Namespace, pvc.Name, "pvc-snapshottable-tester", command, e2epod.NodeSelection{Name: config.ClientNodeName}) - defer StopPod(cs, pod) - err = e2epv.WaitForPersistentVolumeClaimPhase(v1.ClaimBound, cs, pvc.Namespace, pvc.Name, framework.Poll, framework.ClaimProvisionTimeout) framework.ExpectNoError(err) 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 c05cb4a4dd2..9a042f84b79 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 @@ -15,18 +15,8 @@ spec: spec: serviceAccountName: csi-gce-pd-controller-sa containers: - - name: csi-snapshotter - # TODO: replace with official 2.0.0 release when ready - image: quay.io/k8scsi/csi-snapshotter:v2.0.0-rc2 - args: - - "--v=5" - - "--csi-address=/csi/csi.sock" - imagePullPolicy: Always - volumeMounts: - - name: socket-dir - mountPath: /csi - name: csi-provisioner - image: quay.io/k8scsi/csi-provisioner:v1.5.0-rc1 + image: gcr.io/gke-release/csi-provisioner:v1.4.0-gke.0 args: - "--v=5" - "--csi-address=/csi/csi.sock" diff --git a/test/e2e/testing-manifests/storage-csi/gce-pd/csi-controller-rbac.yaml b/test/e2e/testing-manifests/storage-csi/gce-pd/csi-controller-rbac.yaml index 7757d756c97..53a07f34b69 100644 --- a/test/e2e/testing-manifests/storage-csi/gce-pd/csi-controller-rbac.yaml +++ b/test/e2e/testing-manifests/storage-csi/gce-pd/csi-controller-rbac.yaml @@ -29,12 +29,6 @@ rules: - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "watch"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots"] - verbs: ["get", "list"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotcontents"] - verbs: ["get", "list"] --- @@ -49,7 +43,7 @@ roleRef: kind: ClusterRole name: csi-gce-pd-provisioner-role apiGroup: rbac.authorization.k8s.io - + --- # xref: https://github.com/kubernetes-csi/external-attacher/blob/master/deploy/kubernetes/rbac.yaml kind: ClusterRole @@ -118,39 +112,6 @@ roleRef: name: csi-gce-pd-resizer-role apiGroup: rbac.authorization.k8s.io ---- -# xref: https://github.com/kubernetes-csi/external-snapshotter/blob/master/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-gce-pd-snapshotter-role -rules: - - apiGroups: [""] - resources: ["events"] - verbs: ["list", "watch", "create", "update", "patch"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotclasses"] - verbs: ["get", "list", "watch"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotcontents"] - verbs: ["get", "list", "watch", "update", "delete", "patch"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotcontents/status"] - verbs: ["update", "patch"] - ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-gce-pd-controller-snapshotter-binding -subjects: - - kind: ServiceAccount - name: csi-gce-pd-controller-sa -roleRef: - kind: ClusterRole - name: csi-gce-pd-snapshotter-role - apiGroup: rbac.authorization.k8s.io - --- # priviledged Pod Security Policy, previously defined via PrivilegedTestPSPClusterRoleBinding() kind: ClusterRoleBinding @@ -160,6 +121,7 @@ metadata: subjects: - kind: ServiceAccount name: csi-gce-pd-controller-sa + namespace: default roleRef: kind: ClusterRole name: e2e-test-privileged-psp