Skip to content
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

🌱 Enforce skip upgrade policy in clusterctl #12017

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
We recently improved CAPI version support policies clarifying that we support only n-3 skip upgrades, and we are now using this assumption as a cornerstone to plan API removal activities in #11919 and #11920

However, I noticed that in the clusterctl upgrade doc we were stating something slightly different, so I removed this inconsistency, but then I started thinking about the fact that clusterctl can help users preventing issue.

So I extended a little bit this PR adding a first version of skip upgrade policy check.
For now this check is hardcoded and limited to core CAPI and providers in the core repo; if there is interest we can consider extending the clustectl contract so any provider can declare it's own skip upgrade rules and enforce them via clusterctl

/area clusterctl

@k8s-ci-robot k8s-ci-robot added the area/clusterctl Issues or PRs related to clusterctl label Mar 24, 2025
@k8s-ci-robot k8s-ci-robot requested a review from JoelSpeed March 24, 2025 13:47
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 24, 2025
@k8s-ci-robot k8s-ci-robot requested a review from Jont828 March 24, 2025 13:47
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 24, 2025
@chrischdi
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 24, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5a4217b0e48fcd6f5202d4709cbb271b9c18febe

return errors.Wrapf(err, "failed to parse next version for %s provider", upgradeItem.InstanceName())
}

if nextVersion.Minor >= currentVersion.Minor+3 {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if nextVersion.Minor >= currentVersion.Minor+3 {
if nextVersion.Minor > currentVersion.Minor+3 {

Current code would block a n-3 => n upgrade which we want to support

Copy link
Member

Choose a reason for hiding this comment

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

Please also adjust unit test coverage accordingly (i.e. it should cover that n-3 => n is allowed)

@sbueringer
Copy link
Member

Feel free to cherry-pick if desired once findings are addressed

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2025
@k8s-ci-robot k8s-ci-robot requested a review from chrischdi March 25, 2025 10:29
@fabriziopandini fabriziopandini added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Mar 25, 2025
@sbueringer
Copy link
Member

Lgtm pending test coverage, xref: #12017 (comment)

@sbueringer
Copy link
Member

Took a closer look, would be too much effort to add additional test coverage there. We'll eventually have the test coverage in e2e tests

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: b7f812e488012e8e976eda9095dec91bf8c84c83

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 25, 2025
@k8s-ci-robot k8s-ci-robot merged commit 1ff9019 into kubernetes-sigs:main Mar 25, 2025
19 of 20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.11 milestone Mar 25, 2025
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/clusterctl Issues or PRs related to clusterctl 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants