@@ -1169,6 +1169,13 @@ func (r *Reconciler) needUpdate(pod *corev1.Pod) bool {
1169
1169
}
1170
1170
}
1171
1171
1172
+ var pod_label = pod .Labels ["backingstore" ]
1173
+ var bs_label = r .BackingStore .Labels ["backingstore" ]
1174
+ if (bs_label != "" ) && (pod_label != bs_label ) {
1175
+ r .Logger .Warnf ("Backingstore lable has been modified to (%v) and it is different from pod lable: (%v)" , bs_label , pod_label )
1176
+ return true
1177
+ }
1178
+
1172
1179
for _ , name := range []string {"NOOBAA_LOG_LEVEL" , "NOOBAA_LOG_COLOR" } {
1173
1180
configMapValue := r .CoreAppConfig .Data [name ]
1174
1181
noobaaLogEnvVar := util .GetEnvVariable (& c .Env , name )
@@ -1305,10 +1312,16 @@ func (r *Reconciler) updatePodTemplate() error {
1305
1312
r .PodAgentTemplate .Spec .ImagePullSecrets =
1306
1313
[]corev1.LocalObjectReference {* r .NooBaa .Spec .ImagePullSecret }
1307
1314
}
1315
+
1316
+ bs_label , ok := r .BackingStore .Labels ["backingstore" ]
1317
+ if ! ok || bs_label == "" {
1318
+ bs_label = "noobaa"
1319
+ }
1320
+
1308
1321
r .PodAgentTemplate .Labels = map [string ]string {
1309
1322
"app" : "noobaa" ,
1310
1323
"pool" : r .BackingStore .Name ,
1311
- "backingstore" : "noobaa" ,
1324
+ "backingstore" : bs_label ,
1312
1325
}
1313
1326
if r .NooBaa .Spec .Tolerations != nil {
1314
1327
r .PodAgentTemplate .Spec .Tolerations = r .NooBaa .Spec .Tolerations
@@ -1329,7 +1342,7 @@ func (r *Reconciler) updatePodTemplate() error {
1329
1342
NodeTaintsPolicy : & honor ,
1330
1343
LabelSelector : & metav1.LabelSelector {
1331
1344
MatchLabels : map [string ]string {
1332
- "backingstore" : "noobaa" ,
1345
+ "backingstore" : bs_label ,
1333
1346
},
1334
1347
},
1335
1348
}
0 commit comments