-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noobaa/Backingstore : Need facility to change labels #1489
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ apiVersion: noobaa.io/v1alpha1 | |
kind: BackingStore | ||
metadata: | ||
name: default | ||
labels: | ||
backingstore: noobaa | ||
spec: |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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"] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and we can check here if label is provided in backingstore then we will update the label in pv-pods. |
||||||
if pod_label != bs_label { | ||||||
return true | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should log a warn msg here if the label is updated |
||||||
} | ||||||
|
||||||
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, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
wdyt? Can we change the label name to |
||||||
}, | ||||||
}, | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid setting a default label for the BackingStore. Instead, users should have the flexibility to add the label as needed.