-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🐛 Fix validation of worker topology names in Cluster resource #12069
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
base: main
Are you sure you want to change the base?
🐛 Fix validation of worker topology names in Cluster resource #12069
Conversation
…etes resource name The worker topology name is used to generate the name of a Kubernetes resource (MachineDelpoyment or MachinePool), and must therefore be a valid Kubernetes resource name.
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When I introduced The MD webhook was not a factor there because we limit the name actually used for the MD here:
As we already had that validation in the webhook. Let's reduce the MaxLengths accordingly |
…bernetes resource names Use IsDNS1123Subdomain
…bernetes resource names Check that Name is both a valid Kubernetes resource name, and a valid label value
… Kubernetes resource name Add tests for maximum length and invalid characters in a label value
… Kubernetes resource name Test for max length should fail due to max length, not due to uppercase characters
…bernetes resource names Explain why we use IsValidLabelValue check
… Kubernetes resource name Add tests to check package
What this PR does / why we need it:
The worker topology name is used to generate the name of a Kubernetes resource (MachineDelpoyment or MachinePool), and must therefore be a valid Kubernetes resource name. The existing validation does not ensure this.
The first commit adds tests; without a fix, they fail, as expected.
The second commit fixes the validation.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #12068
/area clusterclass