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)