Skip to content

Commit 20d830f

Browse files
committed
change the cm check to check for existance and data of cm before mount the data in the core and endpoint pods
Signed-off-by: shirady <[email protected]>
1 parent c671827 commit 20d830f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pkg/system/phase2_creating.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ func (r *Reconciler) SetDesiredCoreApp() error {
549549
if r.NooBaa.Spec.CoreResources != nil {
550550
c.Resources = *r.NooBaa.Spec.CoreResources
551551
}
552-
if util.KubeCheckQuiet(r.CaBundleConf) {
552+
// we want to check that the cm exists and also that it has data in it
553+
if util.KubeCheckQuiet(r.CaBundleConf) && len(r.CaBundleConf.Data) > 0 {
553554
configMapVolumeMounts := []corev1.VolumeMount{{
554555
Name: r.CaBundleConf.Name,
555556
MountPath: "/etc/ocp-injected-ca-bundle",
@@ -632,7 +633,8 @@ func (r *Reconciler) SetDesiredCoreApp() error {
632633
Limits: logResourceList,
633634
}
634635
}
635-
if util.KubeCheckQuiet(r.CaBundleConf) {
636+
// we want to check that the cm exists and also that it has data in it
637+
if util.KubeCheckQuiet(r.CaBundleConf) && len(r.CaBundleConf.Data) > 0 {
636638
configMapVolumeMounts := []corev1.VolumeMount{{
637639
Name: r.CaBundleConf.Name,
638640
MountPath: "/etc/ocp-injected-ca-bundle",
@@ -675,7 +677,8 @@ func (r *Reconciler) SetDesiredCoreApp() error {
675677

676678
r.CoreApp.Spec.Template.Annotations["noobaa.io/configmap-hash"] = r.CoreAppConfig.Annotations["noobaa.io/configmap-hash"]
677679

678-
if util.KubeCheckQuiet(r.CaBundleConf) {
680+
// we want to check that the cm exists and also that it has data in it
681+
if util.KubeCheckQuiet(r.CaBundleConf) && len(r.CaBundleConf.Data) > 0 {
679682
configMapVolumes := []corev1.Volume{{
680683
Name: r.CaBundleConf.Name,
681684
VolumeSource: corev1.VolumeSource{

pkg/system/phase4_configuring.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,8 @@ func (r *Reconciler) setDesiredEndpointMounts(podSpec *corev1.PodSpec, container
493493
podSpec.Volumes = r.DefaultDeploymentEndpoint.Volumes
494494
container.VolumeMounts = r.DefaultDeploymentEndpoint.Containers[0].VolumeMounts
495495

496-
if util.KubeCheckQuiet(r.CaBundleConf) {
496+
// we want to check that the cm exists and also that it has data in it
497+
if util.KubeCheckQuiet(r.CaBundleConf) && len(r.CaBundleConf.Data) > 0 {
497498
configMapVolumes := []corev1.Volume{{
498499
Name: r.CaBundleConf.Name,
499500
VolumeSource: corev1.VolumeSource{

0 commit comments

Comments
 (0)