From 5a53a9ad768b493da2a8bc1c404b47c0787fdd6f Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 2 Sep 2021 10:36:21 +0530 Subject: [PATCH] e2e: update e2e deployment for ceph conf updated e2e deployment code to create and delete the ceph conf configmap. Signed-off-by: Madhu Rajanna --- e2e/cephfs.go | 15 ++++++++++++++- e2e/rbd.go | 17 ++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index d8271e7c1..cb01f988a 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -28,7 +28,7 @@ var ( cephfsDeamonSetName = "csi-cephfsplugin" cephfsContainerName = "csi-cephfsplugin" cephfsDirPath = "../deploy/cephfs/kubernetes/" - cephfsExamplePath = "../examples/cephfs/" + cephfsExamplePath = examplePath + "cephfs/" subvolumegroup = "e2e" fileSystemName = "myfs" ) @@ -76,6 +76,19 @@ func createORDeleteCephfsResources(action kubectlAction) { e2elog.Failf("failed to %s CSIDriver object with error %v", action, err) } } + cephConf, err := ioutil.ReadFile(examplePath + cephConfconfigMap) + if err != nil { + // createORDeleteCephfsResources is used for upgrade testing as cephConfConfigmap is + // newly added, discarding file not found error. + if !os.IsNotExist(err) { + e2elog.Failf("failed to read content from %s with error %v", examplePath+cephConfconfigMap, err) + } + } else { + err = retryKubectlInput(cephCSINamespace, action, string(cephConf), deployTimeout) + if err != nil { + e2elog.Failf("failed to %s ceph-conf configmap object with error %v", action, err) + } + } data, err := replaceNamespaceInTemplate(cephfsDirPath + cephfsProvisioner) if err != nil { e2elog.Failf("failed to read content from %s with error %v", cephfsDirPath+cephfsProvisioner, err) diff --git a/e2e/rbd.go b/e2e/rbd.go index 649d7ed0b..61d6412c0 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -28,9 +28,11 @@ var ( rbdNodePluginRBAC = "csi-nodeplugin-rbac.yaml" rbdNodePluginPSP = "csi-nodeplugin-psp.yaml" configMap = "csi-config-map.yaml" + cephConfconfigMap = "ceph-conf.yaml" csiDriverObject = "csidriver.yaml" rbdDirPath = "../deploy/rbd/kubernetes/" - rbdExamplePath = "../examples/rbd/" + examplePath = "../examples/" + rbdExamplePath = examplePath + "/rbd/" rbdDeploymentName = "csi-rbdplugin-provisioner" rbdDaemonsetName = "csi-rbdplugin" defaultRBDPool = "replicapool" @@ -102,6 +104,19 @@ func createORDeleteRbdResources(action kubectlAction) { e2elog.Failf("failed to %s CSIDriver object with error %v", action, err) } } + cephConf, err := ioutil.ReadFile(examplePath + cephConfconfigMap) + if err != nil { + // createORDeleteRbdResources is used for upgrade testing as cephConf Configmap is + // newly added, discarding file not found error. + if !os.IsNotExist(err) { + e2elog.Failf("failed to read content from %s with error %v", examplePath+cephConfconfigMap, err) + } + } else { + err = retryKubectlInput(cephCSINamespace, action, string(cephConf), deployTimeout) + if err != nil { + e2elog.Failf("failed to %s ceph-conf configmap object with error %v", action, err) + } + } data, err := replaceNamespaceInTemplate(rbdDirPath + rbdProvisioner) if err != nil { e2elog.Failf("failed to read content from %s with error %v", rbdDirPath+rbdProvisioner, err)