mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +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
|
//deploy cephfs CSI
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
createFileSystem(f.ClientSet)
|
createFileSystem(f.ClientSet)
|
||||||
|
createConfigMap(f.ClientSet, f)
|
||||||
deployCephfsPlugin()
|
deployCephfsPlugin()
|
||||||
createCephfsStorageClass(f.ClientSet)
|
createCephfsStorageClass(f.ClientSet, f)
|
||||||
createCephfsSecret(f.ClientSet, f)
|
createCephfsSecret(f.ClientSet, f)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ var _ = Describe("RBD", func() {
|
|||||||
//deploy RBD CSI
|
//deploy RBD CSI
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
createRBDPool()
|
createRBDPool()
|
||||||
createRBDConfigMap(f.ClientSet, f)
|
createConfigMap(f.ClientSet, f)
|
||||||
deployRBDPlugin()
|
deployRBDPlugin()
|
||||||
createRBDStorageClass(f.ClientSet, f)
|
createRBDStorageClass(f.ClientSet, f)
|
||||||
createRBDSecret(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
|
return sc
|
||||||
}
|
}
|
||||||
|
|
||||||
func createCephfsStorageClass(c kubernetes.Interface) {
|
func createCephfsStorageClass(c kubernetes.Interface, f *framework.Framework) {
|
||||||
scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "storageclass.yaml")
|
scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "storageclass.yaml")
|
||||||
sc := getStorageClass(c, scPath)
|
sc := getStorageClass(c, scPath)
|
||||||
sc.Parameters["pool"] = "myfs-data0"
|
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)
|
_, err := c.StorageV1().StorageClasses().Create(&sc)
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
}
|
}
|
||||||
@ -177,7 +183,7 @@ func createRBDStorageClass(c kubernetes.Interface, f *framework.Framework) {
|
|||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
}
|
}
|
||||||
|
|
||||||
func createRBDConfigMap(c kubernetes.Interface, f *framework.Framework) {
|
func createConfigMap(c kubernetes.Interface, f *framework.Framework) {
|
||||||
path := rbdDirPath + rbdConfigMap
|
path := rbdDirPath + rbdConfigMap
|
||||||
cm := v1.ConfigMap{}
|
cm := v1.ConfigMap{}
|
||||||
err := unmarshal(path, &cm)
|
err := unmarshal(path, &cm)
|
||||||
|
Loading…
Reference in New Issue
Block a user