From 90762342a0b272bde17e95c4ef6d8ff8945c6f27 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Mon, 3 Aug 2020 22:30:27 +0530 Subject: [PATCH] e2e: introduce createCephFSSnapshotClass creation Signed-off-by: Humble Chirammal --- e2e/snapshot.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e2e/snapshot.go b/e2e/snapshot.go index 3ed37896c..672549145 100644 --- a/e2e/snapshot.go +++ b/e2e/snapshot.go @@ -128,3 +128,17 @@ func createRBDSnapshotClass(f *framework.Framework) { _, err = sclient.SnapshotV1beta1().VolumeSnapshotClasses().Create(context.TODO(), &sc, metav1.CreateOptions{}) Expect(err).Should(BeNil()) } + +func createCephFSSnapshotClass(f *framework.Framework) { + scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "snapshotclass.yaml") + sc := getSnapshotClass(scPath) + sc.Parameters["csi.storage.k8s.io/snapshotter-secret-namespace"] = cephCSINamespace + fsID, stdErr := execCommandInToolBoxPod(f, "ceph fsid", rookNamespace) + Expect(stdErr).Should(BeEmpty()) + fsID = strings.Trim(fsID, "\n") + sc.Parameters["clusterID"] = fsID + sclient, err := newSnapshotClient() + Expect(err).Should(BeNil()) + _, err = sclient.SnapshotV1beta1().VolumeSnapshotClasses().Create(context.TODO(), &sc, metav1.CreateOptions{}) + Expect(err).Should(BeNil()) +}