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

🐛 Performs KCP version check on control plane update #3508

Merged

Conversation

srm09
Copy link
Contributor

@srm09 srm09 commented Aug 20, 2020

What this PR does / why we need it:
This PR is needed to disallow users from downgrading the control plane versions as well as skipping minor versions during upgrades.

Which issue(s) this PR fixes:
Fixes #2578

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 20, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @srm09. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 20, 2020
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 20, 2020
@srm09
Copy link
Contributor Author

srm09 commented Aug 20, 2020

@vincepri Does it make sense to add logic for major versions?

@neolit123
Copy link
Member

neolit123 commented Aug 20, 2020

hi, would there be a way to override the behavior of this webhook and not error out on downgrade / minor skip?

@vincepri
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 20, 2020
@srm09 srm09 force-pushed the bug/control-plane-version-check branch from 00d971c to c5158cb Compare August 20, 2020 23:29
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 20, 2020
@srm09 srm09 force-pushed the bug/control-plane-version-check branch from 3b84ffd to 6f7ffc3 Compare August 21, 2020 20:45
@vincepri
Copy link
Member

/milestone v0.3.9

@k8s-ci-robot k8s-ci-robot added this to the v0.3.9 milestone Aug 24, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/assign @ncdc

@srm09 Please squash before we merge this in

@k8s-ci-robot
Copy link
Contributor

[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 /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 Aug 24, 2020
@srm09 srm09 force-pushed the bug/control-plane-version-check branch from ae835ba to 7ebc477 Compare August 24, 2020 19:09
This patch adds the ability to check the version of the
KubeadmControlPlane on updates. The update fails if the user tries to
downgrade the control plane version or skip minor versions.

Signed-off-by: Sagar Muchhal <muchhals@vmware.com>
Co-authored-by: Vince Prignano <vince@vincepri.com>
@srm09 srm09 force-pushed the bug/control-plane-version-check branch from 7ebc477 to 53cbd91 Compare August 24, 2020 21:26
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

/hold to wait for @ncdc since he made a previous comment to change

@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 Aug 25, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 25, 2020
@ncdc
Copy link
Contributor

ncdc commented Aug 25, 2020

LGTM, thanks!

/hold cancel

@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 Aug 25, 2020
Copy link

@benmoss benmoss left a comment

Choose a reason for hiding this comment

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

I don't think we're restricting downgrades either with this. I was concerned when I read that in your PR description since I don't know if we want to actually do that, but the logic as is in this doesn't seem to do that.

}

// since upgrades to the next minor version are allowed, irrespective of the patch version
ceilVersion := semver.Version{
Copy link

Choose a reason for hiding this comment

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

This is not the ceiling but actually the first disallowed version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I make a tiny PR to address this @benmoss ?

Copy link

Choose a reason for hiding this comment

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

Meh, I don't think you need to bother

@k8s-ci-robot k8s-ci-robot merged commit c946b8a into kubernetes-sigs:master Aug 25, 2020
@srm09 srm09 deleted the bug/control-plane-version-check branch August 25, 2020 18:14
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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

KCP: validate version changes are no further than one minor version
7 participants