-
Couldn't load subscription status.
- Fork 1.4k
✨ Add lifecycle hooks for chained-upgrade #12878
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
✨ Add lifecycle hooks for chained-upgrade #12878
Conversation
e8af4c6 to
44888d3
Compare
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.
I'm not sure why diff is so bad 😓
what I did is
- minor adjustments to TestComputeControlPlaneVersion
- drop TestComputeControlPlaneVersion_callAfterControlPlaneUpgrade and TestComputeControlPlaneVersion_callBeforeClusterUpgrade_trackIntentOfCallingAfterClusterUpgrade because they are replaced by the new test in lifecycle_hooks_test.go
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.
Looks better if you enable "ignore whitespace diff"
44888d3 to
cae6d82
Compare
|
/test pull-cluster-api-e2e-main |
cae6d82 to
21b0d44
Compare
|
/test pull-cluster-api-e2e-main |
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.
Looks better if you enable "ignore whitespace diff"
| } | ||
|
|
||
| func validateHookRequest(request runtimehooksv1.RequestObject, wantRequest runtimehooksv1.RequestObject) error { | ||
| if request, ok := request.(*runtimehooksv1.BeforeClusterUpgradeRequest); ok { |
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.
Why can't this just be a simple compare between two types? (e.g. with cmp.Diff)
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.
I did not use cmp.diff because there was already specific code to validate the cluster parameter in the request and I did not want to loose this coverage, so I extended it to validate specifically the additional parameters we care about for each request types
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.
Setting Cluster to equal and then using cmp.Diff seems much safer to me
Let's remember to extend this check when we introduce new fields to the types
|
/lgtm |
|
LGTM label has been added. Git tree hash: 09871b784dc24e0ea897c3c07b1bb2b517f53056
|
|
[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 |
What this PR does / why we need it:
Add new lifecycle hooks / change existing hooks as defined by the lifecycle hooks proposal.
Which issue(s) this PR fixes:
Rif #12720