Skip to content

🐛 ClusterClass: Don't allow concurrent patch upgrades #11940

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

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Mar 7, 2025

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:
The Cluster webhook only prevents concurrent minor version upgrades. With this PR we also block concurrent patch upgrades.

The reason is because the Cluster topology controller cannot handle multiple ongoing upgrades correctly.

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 #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 7, 2025
@k8s-ci-robot k8s-ci-robot requested a review from chrischdi March 7, 2025 14:47
@k8s-ci-robot k8s-ci-robot added the do-not-merge/needs-area PR is missing an area label label Mar 7, 2025
@k8s-ci-robot k8s-ci-robot requested a review from JoelSpeed March 7, 2025 14:47
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 7, 2025
@sbueringer sbueringer added the area/clusterclass Issues or PRs related to clusterclass label Mar 7, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Mar 7, 2025
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/assign @fabriziopandini @chrischdi

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a29d4de0981900f355749206eeb61f2dc5aaa258

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one comment, but up to you if to defer

@@ -501,7 +494,7 @@ func (webhook *Cluster) validateTopologyVersion(ctx context.Context, fldPath *fi
return field.Invalid(
fldPath,
fldValue,
fmt.Sprintf("minor version update cannot happen at this time: %v", kerrors.NewAggregate(allErrs)),
fmt.Sprintf("version update cannot happen at this time: %v", kerrors.NewAggregate(allErrs)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok to defer to a follow-up PR, but the error messages seems not ideal:

"version update cannot happen at this time: blocking version update due to ControlPlane version check: ControlPlane version %q does not match the current version %q, blocking version update due to MachineDeployment version check: there are MachineDeployments still completing a previous upgrade: [%s], there are MachinePools still completing a previous upgrade: [%s]"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you like to optimize it?

@chrischdi Opinions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give it a try

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be better now

@sbueringer sbueringer force-pushed the pr-no-concurrent-upgrades branch from b9d6f26 to b2b32e2 Compare March 7, 2025 16:46
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2025
@sbueringer
Copy link
Member Author

Will take a look....

@sbueringer sbueringer force-pushed the pr-no-concurrent-upgrades branch from b2b32e2 to f314e27 Compare March 7, 2025 17:00
@sbueringer
Copy link
Member Author

@fabriziopandini @chrischdi PTAL :)

@fabriziopandini
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cca4d55adee6a6f5043f3e61a1b740b01340ca73

@chrischdi
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2025
@chrischdi
Copy link
Member

chrischdi commented Mar 11, 2025

/hold
for your convenience

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2025
@chrischdi
Copy link
Member

/hold cancel

As mentioned in the discussion, can also be a follow-up if we want to change more.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2025
@k8s-ci-robot k8s-ci-robot merged commit 44935f5 into kubernetes-sigs:main Mar 11, 2025
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Mar 11, 2025
@sbueringer sbueringer deleted the pr-no-concurrent-upgrades branch March 11, 2025 08:43
@sbueringer
Copy link
Member Author

/cherry-pick release-1.9

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #11970

In response to this:

/cherry-pick release-1.9

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/clusterclass Issues or PRs related to clusterclass cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants