-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨ Refactor MS controller status patching #1944
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
✨ Refactor MS controller status patching #1944
Conversation
[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 |
/hold |
2fd1671
to
acd13dc
Compare
/hold cancel |
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.
The bulk of this was just copy/paste across files, right?
acd13dc
to
4b738bc
Compare
/assign @detiber |
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.
Question related to ignoring the error when converting the labelselector, otherwise, lgtm
controllers/machineset_controller.go
Outdated
|
||
// Copy label selector to its status counterpart in string format. | ||
// This is necessary for CRDs including scale subresources. | ||
selector, _ := metav1.LabelSelectorAsSelector(&ms.Spec.Selector) |
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.
Is it actually safe to ignore the error here? I know we have a validating webhook now, but that wouldn't affect pre-existing stored resources (unless they have been read and then re-written to the new storage version).
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 figured given that we're coming from a LabelSelector
type that this function should never return an error, unless something very wrong happened.
I'll add it though, just to be safe
4b738bc
to
4c1687a
Compare
Signed-off-by: Vince Prignano <[email protected]>
4c1687a
to
a6db0cc
Compare
/lgtm |
Signed-off-by: Vince Prignano [email protected]
What this PR does / why we need it:
This PR improves the MachineSet code by:
calculateStatus
instead of the main reconciler function.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Related to #1689