-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Validate StatefulSet names as DNS Label #114172
Validate StatefulSet names as DNS Label #114172
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Nov 28 21:37:18 UTC 2022. |
@thockin: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Any StatefuleSet which took advantage of this (by having dots in the name) can't have worked because we set `pod.spec.hostname` from it, which is validated as a DNS label. So while this is strictly a breaking change, it doesn't break anything that was not already broken.
5bed61f
to
f4c1682
Compare
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/lgtm |
/retest |
// Currently this is just "-index". In the future we may allow a user | ||
// specified list of suffixes and we need to validate the longest one. | ||
return apimachineryvalidation.NameIsDNSSubdomain(name, prefix) | ||
return apimachineryvalidation.NameIsDNSLabel(name, prefix) |
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.
looks like there's a call chain of ValidateStatefulSetUpdate → ValidateStatefulSet → ValidateStatefulSetName
if someone has a statefulset with a "bad" name and a finalizer, and upgrades to 1.27, does this change mean they can't remove the finalizer and delete the statefulset?
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 was going to argue that such a statefulset could never have worked, and so would only be reasonable to delete, but finalizer is an excellent corner case.
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.
Any StatefulSet which took advantage of this (by having dots in the name) can't have worked because we set
pod.spec.hostname
from it, which is validated as a DNS label.So while this is strictly a breaking change, it doesn't break anything that was not already broken.
xref #104195
/kind bug
/kind api-change