-
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
Convert machineSpec.Versions to a pointer #683
Conversation
Hi @enxebre. Thanks for your PR. I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: enxebre If they are not already assigned, you can assign the PR to them by writing 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 |
@@ -70,7 +70,7 @@ type MachineSpec struct { | |||
// should populate the values it uses when persisting Machine objects. | |||
// A Machine spec missing this field at runtime is invalid. | |||
// +optional | |||
Versions MachineVersionInfo `json:"versions,omitempty"` | |||
Versions *MachineVersionInfo `json:"versions,omitempty"` |
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.
All consumers of the field will be required to change the field access logic. Their code will start to panic in cases where the Versions
field is nil.
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.
such changes are usually more suited in v1alphaX increments.
/ok-to-test |
as well |
/test pull-cluster-api-test |
|
Fixes part of #552 |
Sorry, after closing #552 I saw this Pull.
So the advantage of this PR is basically that we don't store+transmit a field when its not used? |
@alvaroaleman yes, so it's actually omitted when empty |
I'm a bit confused why we are replicating the version info between Spec and Status currently? I think the idea of having separate provider implementations that optionally use either the spec and/or the status seems counter-intuitive. We should probably just standardize on the use of the Spec and then implementations could add their own validating and/or defaulting webhooks to enforce the behavior they expect out of how users and/or controllers interact with the spec field. |
Could someone please summarize the state of this PR & the thinking about it - do we still want this? |
I'm a little concerned on making the field optional for v1alpha1. There are a lot of providers that rely on the versions being populated to check if a node is a control plane or not. |
As does the |
If we agree on the change I'd say the sooner the better for transitioning. Providers should probably rely on the abstraction https://github.com/kubernetes-sigs/cluster-api/pull/683/files#diff-6c6a7fefe37261e2fa8a010cf9e7ae08R120 so changes are transparent. Other than that I don't have strong opinions for pre/post alpha |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Closing since the v1alpha1 types shouldn't be changed at this point. |
@detiber: Closed this PR. 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:
Convert machineSpec.Versions to a pointer so
omitempty
does not actually marshals the field since it's optional consistently with Status.Versions.For use cases where the machine config aka kubelet is managed orthogonally to the machine infra the field in the spec wouldn't trigger a moving forward reconciliation hence it wouldn't be leveraged.
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 #
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: