mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
e2e: introduce createCephFSSnapshotClass creation
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
2d72550a39
commit
90762342a0
@ -128,3 +128,17 @@ func createRBDSnapshotClass(f *framework.Framework) {
|
|||||||
_, err = sclient.SnapshotV1beta1().VolumeSnapshotClasses().Create(context.TODO(), &sc, metav1.CreateOptions{})
|
_, err = sclient.SnapshotV1beta1().VolumeSnapshotClasses().Create(context.TODO(), &sc, metav1.CreateOptions{})
|
||||||
Expect(err).Should(BeNil())
|
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())
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user