-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix sanitization of DC label (fixes #622) #623
Conversation
@@ -144,7 +144,7 @@ func (rc *ReconciliationContext) listPVCs() (*corev1.PersistentVolumeClaimList, | |||
rc.ReqLogger.Info("reconciler::listPVCs") | |||
|
|||
selector := map[string]string{ | |||
api.DatacenterLabel: rc.Datacenter.Name, | |||
api.DatacenterLabel: api.CleanLabelValue(rc.Datacenter.DatacenterName()), |
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.
This was probably a bug.
@@ -133,7 +133,7 @@ var _ = Describe(testName, func() { | |||
wg.Add(1) | |||
go func() { | |||
k = kubectl.Logs("-f"). | |||
WithLabel(fmt.Sprintf("statefulset.kubernetes.io/pod-name=cluster1-%s-r1-sts-0", api.CleanupForKubernetes(dcNameOverride))). | |||
WithLabel(fmt.Sprintf("statefulset.kubernetes.io/pod-name=cluster1-%s-r1-sts-0", api.CleanLabelValue(dcNameOverride))). |
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.
issue: This is wrong and the test shouldn't pass if we mess up naming of the StatefulSet. The StatefulSet name must adhere to the CleanupForKubernetes process (minimum), not CleanLabelValue as those values are not allowed in the StatefulSet's name.
Although we're polling for label value here, the DNS name of the pod matters. The name defined must match what's in here:
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.
Ah, my bad, I saw a label and just changed the function, not realizing that the value was actually referencing a resource name. I'll revert this.
@burmanm is the |
What this PR does:
Fix sanitization of DC label
Which issue(s) this PR fixes:
Fixes #622
Checklist