mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 22:30:23 +00:00
Update configmap if already present
in e2e if the configmap is ready present, we need to update it to make life simpler for helm chart e2e. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
22c432cece
commit
b2dfcae802
11
e2e/utils.go
11
e2e/utils.go
@ -368,7 +368,18 @@ func createConfigMap(pluginPath string, c kubernetes.Interface, f *framework.Fra
|
|||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
cm.Data["config.json"] = string(data)
|
cm.Data["config.json"] = string(data)
|
||||||
cm.Namespace = cephCSINamespace
|
cm.Namespace = cephCSINamespace
|
||||||
|
// if the configmap is present update it,during cephcsi helm charts
|
||||||
|
// deployment empty configmap gets created we need to override it
|
||||||
|
_, err = c.CoreV1().ConfigMaps(cephCSINamespace).Get(cm.Name, metav1.GetOptions{})
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
_, updateErr := c.CoreV1().ConfigMaps(cephCSINamespace).Update(&cm)
|
||||||
|
Expect(updateErr).Should(BeNil())
|
||||||
|
}
|
||||||
|
if apierrs.IsNotFound(err) {
|
||||||
_, err = c.CoreV1().ConfigMaps(cephCSINamespace).Create(&cm)
|
_, err = c.CoreV1().ConfigMaps(cephCSINamespace).Create(&cm)
|
||||||
|
}
|
||||||
|
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user