-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 Ensure MachinePool Version is a valid Kubernetes version #6311
🐛 Ensure MachinePool Version is a valid Kubernetes version #6311
Conversation
/lgtm |
|
||
// tolerate version strings without a "v" prefix: prepend it if it's not there. | ||
if m.Spec.Template.Spec.Version != nil && !strings.HasPrefix(*m.Spec.Template.Spec.Version, "v") { | ||
normalizedVersion := "v" + *m.Spec.Template.Spec.Version |
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.
Just to double-check: is this triggering rollouts on existing infrastructure or not?
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.
Only if the user created a MP without the v prefix (which as described in #4651 isn't functional). Once the template version has the v prefix it won't modify it / cause a rollout.
/assign @fabriziopandini |
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.
/approve
Should we backport? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
I leave the call on @CecileRobertMichon (no objections from my side) |
/cherry-pick release-1.1 |
@CecileRobertMichon: new pull request created: #6364 In response to this:
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. |
What this PR does / why we need it: In the past we've added kube semver validations to KCP, MachineDeployment, Machines, and MachineSets. For some reason we missed MachinePool. This PR adds webhook defaulting to add the "v" prefix when it's missing and validation to make sure MachinePool version is valid, as well as unit tests.
Here's the equivalent changeset for MachineSets: https://github.com/kubernetes-sigs/cluster-api/pull/5406/files
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 #