mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
create config map for cephfs
add fs name to storageclass in e2e Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
864e6baea9
commit
a4655f7549
@ -35,8 +35,9 @@ var _ = Describe("cephfs", func() {
|
||||
//deploy cephfs CSI
|
||||
BeforeEach(func() {
|
||||
createFileSystem(f.ClientSet)
|
||||
createConfigMap(f.ClientSet, f)
|
||||
deployCephfsPlugin()
|
||||
createCephfsStorageClass(f.ClientSet)
|
||||
createCephfsStorageClass(f.ClientSet, f)
|
||||
createCephfsSecret(f.ClientSet, f)
|
||||
})
|
||||
|
||||
|
@ -36,7 +36,7 @@ var _ = Describe("RBD", func() {
|
||||
//deploy RBD CSI
|
||||
BeforeEach(func() {
|
||||
createRBDPool()
|
||||
createRBDConfigMap(f.ClientSet, f)
|
||||
createConfigMap(f.ClientSet, f)
|
||||
deployRBDPlugin()
|
||||
createRBDStorageClass(f.ClientSet, f)
|
||||
createRBDSecret(f.ClientSet, f)
|
||||
|
10
e2e/utils.go
10
e2e/utils.go
@ -154,10 +154,16 @@ func getStorageClass(c kubernetes.Interface, path string) scv1.StorageClass {
|
||||
return sc
|
||||
}
|
||||
|
||||
func createCephfsStorageClass(c kubernetes.Interface) {
|
||||
func createCephfsStorageClass(c kubernetes.Interface, f *framework.Framework) {
|
||||
scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "storageclass.yaml")
|
||||
sc := getStorageClass(c, scPath)
|
||||
sc.Parameters["pool"] = "myfs-data0"
|
||||
sc.Parameters["fsName"] = "myfs"
|
||||
fsID := execCommandInToolBox(f, "ceph fsid")
|
||||
//remove new line present in fsID
|
||||
fsID = strings.Trim(fsID, "\n")
|
||||
|
||||
sc.Parameters["clusterID"] = fsID
|
||||
_, err := c.StorageV1().StorageClasses().Create(&sc)
|
||||
Expect(err).Should(BeNil())
|
||||
}
|
||||
@ -177,7 +183,7 @@ func createRBDStorageClass(c kubernetes.Interface, f *framework.Framework) {
|
||||
Expect(err).Should(BeNil())
|
||||
}
|
||||
|
||||
func createRBDConfigMap(c kubernetes.Interface, f *framework.Framework) {
|
||||
func createConfigMap(c kubernetes.Interface, f *framework.Framework) {
|
||||
path := rbdDirPath + rbdConfigMap
|
||||
cm := v1.ConfigMap{}
|
||||
err := unmarshal(path, &cm)
|
||||
|
Loading…
Reference in New Issue
Block a user