-
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
🌱 Implement topology validations for topology kubernetes version upgrades #10063
🌱 Implement topology validations for topology kubernetes version upgrades #10063
Conversation
6bbb017
to
81d7119
Compare
bdf09a2
to
41d7f68
Compare
Example error:
|
@@ -29,92 +29,6 @@ import ( | |||
"sigs.k8s.io/cluster-api/internal/test/builder" | |||
) | |||
|
|||
func TestIsUpgrading(t *testing.T) { |
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.
This tests got moved to internal/topology/check/upgrade_test.go
@@ -163,22 +137,6 @@ type MachinePoolState struct { | |||
// IsUpgrading determines if the MachinePool is upgrading. | |||
// A machine pool is considered upgrading if at least one of the Machines of this | |||
// MachinePool has a different version. | |||
func (mp *MachinePoolState) IsUpgrading(ctx context.Context, c client.Client) (bool, error) { | |||
// If the MachinePool has no version there is no definitive way to check if it is upgrading. Therefore, return false. |
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.
This code got moved to internal/topology/check/upgrade.go
@@ -101,40 +99,16 @@ type MachineDeploymentState struct { | |||
// IsUpgrading determines if the MachineDeployment is upgrading. | |||
// A machine deployment is considered upgrading if at least one of the Machines of this | |||
// MachineDeployment has a different version. | |||
func (md *MachineDeploymentState) IsUpgrading(ctx context.Context, c client.Client) (bool, error) { | |||
// If the MachineDeployment has no version there is no definitive way to check if it is upgrading. Therefore, return false. |
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.
This code got moved to internal/topology/check/upgrade.go
} | ||
} | ||
|
||
func TestIsMachinePoolUpgrading(t *testing.T) { |
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.
Note: this test did not exist before and we now cover the IsMachinePoolUpgrading function 🎉
Let me know when you're done and I'll take another look (no rush though :)) |
70426f8
to
8dedbd9
Compare
@sbueringer should be ready for review now :-) |
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.
Very nice work!! Just nits remaining
5759ab9
to
cac7281
Compare
Thank you! /lgtm /assign @fabriziopandini |
LGTM label has been added. Git tree hash: 8402f5d3213f70f32c40f7b250886e4abeff03a6
|
…tter> Sideeffects: * webhooks: add ClusterCacheTrackerReader to the cluster webhook for machine pool validations * Introduce annotation unsafe.topology.cluster.x-k8s.io/disable-version-validation
30b41ee
to
da4fa22
Compare
Had to rebase due to merge conflict |
/lgtm |
LGTM label has been added. Git tree hash: 19db04416730ab0633954e11635a9a434ce8b194
|
/lgtm /hold |
LGTM label has been added. Git tree hash: a971171d6a4ddc20acbeac2655ed2104ea0f6c45
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
Squash should not be required /hold cancel |
let test the squash bot |
/cherry-pick release-1.6 Due to targeting the experimental ClusterClass feature |
@chrischdi: new pull request created: #10318 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:
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 #10049
Fixes #9098
/area clusterclass