-
Notifications
You must be signed in to change notification settings - Fork 32
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
🐛 Check MachineConfig spec for full equality with Rke2CPSpec #325
🐛 Check MachineConfig spec for full equality with Rke2CPSpec #325
Conversation
fdd44aa
to
2a7f097
Compare
Signed-off-by: Danil Grigorev <[email protected]>
2a7f097
to
da42f22
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.
LGTM. Just a question on checking the object type.
m, ok := o.(*clusterv1.Machine) | ||
if !ok { | ||
panic(fmt.Sprintf("Expected a Machine but got a %T", o)) | ||
} |
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 this explicit check required? Isn't it guaranteed that the object the controller watches is of type clusterv1.Machine
?
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.
Mostly just copied from kubeadm provider implementation at this point, but this should be guarantied in most of the cases, and is guarantied when using generic watches. Though the desired UX for using generic watches expects to replace all For/Owns
methods with Watches
. This is inconvenient and does not worth the effort. To eliminate the need for an explicit type casting, a set of helper methods can be introduced upstream to connect non generic controller with generic EventMappers of Predicates.
c, ok := o.(*clusterv1.Cluster) | ||
if !ok { | ||
panic(fmt.Sprintf("Expected a Cluster but got a %T", o)) | ||
} |
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.
Same question as with Machine
.
What this PR does / why we need it:
We need to ensure that any change of
RKE2ConfigTemplate
is causing CP machines re-rollout.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 #307
Special notes for your reviewer:
Checklist: