diff --git a/deploy/crds/noobaa.io_v1alpha1_backingstore_cr.yaml b/deploy/crds/noobaa.io_v1alpha1_backingstore_cr.yaml index 702093cae..056d62880 100644 --- a/deploy/crds/noobaa.io_v1alpha1_backingstore_cr.yaml +++ b/deploy/crds/noobaa.io_v1alpha1_backingstore_cr.yaml @@ -2,4 +2,6 @@ apiVersion: noobaa.io/v1alpha1 kind: BackingStore metadata: name: default + labels: + backingstore: noobaa spec: diff --git a/pkg/backingstore/reconciler.go b/pkg/backingstore/reconciler.go index 19499c86f..0b6ae2169 100644 --- a/pkg/backingstore/reconciler.go +++ b/pkg/backingstore/reconciler.go @@ -1169,6 +1169,12 @@ func (r *Reconciler) needUpdate(pod *corev1.Pod) bool { } } + var pod_label = pod.Labels["backingstore"] + var bs_label = r.BackingStore.Labels["backingstore"] + if pod_label != bs_label { + return true + } + for _, name := range []string{"NOOBAA_LOG_LEVEL", "NOOBAA_LOG_COLOR"} { configMapValue := r.CoreAppConfig.Data[name] noobaaLogEnvVar := util.GetEnvVariable(&c.Env, name) @@ -1305,10 +1311,12 @@ func (r *Reconciler) updatePodTemplate() error { r.PodAgentTemplate.Spec.ImagePullSecrets = []corev1.LocalObjectReference{*r.NooBaa.Spec.ImagePullSecret} } + var bs_label = r.BackingStore.Labels["backingstore"] + r.PodAgentTemplate.Labels = map[string]string{ "app": "noobaa", "pool": r.BackingStore.Name, - "backingstore": "noobaa", + "backingstore": bs_label, } if r.NooBaa.Spec.Tolerations != nil { r.PodAgentTemplate.Spec.Tolerations = r.NooBaa.Spec.Tolerations @@ -1329,7 +1337,7 @@ func (r *Reconciler) updatePodTemplate() error { NodeTaintsPolicy: &honor, LabelSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{ - "backingstore": "noobaa", + "backingstore": bs_label, }, }, } diff --git a/pkg/bundle/deploy.go b/pkg/bundle/deploy.go index 5467257d9..7e8d9f0c0 100644 --- a/pkg/bundle/deploy.go +++ b/pkg/bundle/deploy.go @@ -3623,12 +3623,14 @@ spec: status: {} ` -const Sha256_deploy_crds_noobaa_io_v1alpha1_backingstore_cr_yaml = "84ca6f2a35a413e74a51375bd0ec31c33bb76a00de8e0ef8d02a7798e02ec460" +const Sha256_deploy_crds_noobaa_io_v1alpha1_backingstore_cr_yaml = "8fdf39c530933be6f2d81eee4f5e3bd8a11c56e97b81f32d17313817fc0d4d67" const File_deploy_crds_noobaa_io_v1alpha1_backingstore_cr_yaml = `apiVersion: noobaa.io/v1alpha1 kind: BackingStore metadata: name: default + labels: + backingstore: noobaa spec: ` diff --git a/pkg/system/phase4_configuring.go b/pkg/system/phase4_configuring.go index 87062c6c9..797ba8af7 100644 --- a/pkg/system/phase4_configuring.go +++ b/pkg/system/phase4_configuring.go @@ -417,11 +417,11 @@ func (r *Reconciler) SetDesiredDeploymentEndpoint() error { if r.NooBaa.Spec.BucketNotifications.Enabled { envVar := corev1.EnvVar{ - Name: "NOTIFICATION_LOG_DIR", + Name: "NOTIFICATION_LOG_DIR", Value: "/var/logs/notifications", } - util.MergeEnvArrays(&c.Env, &[]corev1.EnvVar{envVar}); + util.MergeEnvArrays(&c.Env, &[]corev1.EnvVar{envVar}) } c.SecurityContext = &corev1.SecurityContext{