✨ Surface aggregated machine versions in status#13341
✨ Surface aggregated machine versions in status#13341miltalex wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This PR is currently missing an area label, which is used to identify the modified component when generating release notes. Area labels can be added by org members by writing Please see the labels list for possible areas. DetailsInstructions 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-sigs/prow repository. |
|
Hi @miltalex. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. DetailsInstructions 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-sigs/prow repository. |
Signed-off-by: Miltiadis Alexis <alexmiltiadis@gmail.com>
0288f90 to
3f39a80
Compare
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
| }) | ||
|
|
||
| return versions | ||
| } |
There was a problem hiding this comment.
thought: This function looks very similar to internal/util/version.VersionsFromMachines, except that it operates on collections.Machines rather than []*clusterv1.Machine.
Would it make sense to call internalversion.VersionsFromMachines(machines.UnsortedList()) here instead, to avoid maintaining two copies of the same logic?
Is there some nuanced difference between the functions? (If so, that'd be useful to note in a comment.)
| mdVersion := md.Spec.Template.Spec.Version | ||
| if len(md.Status.Versions) > 0 { | ||
| for _, statusVersion := range md.Status.Versions { | ||
| if statusVersion.Version != mdVersion { |
There was a problem hiding this comment.
question: The version comparison here uses raw string equality while the existing fallback path below parses versions with semver.ParseTolerant. If a provider or kubelet ever reports the version in a slightly different form (e.g. "1.32.0" vs "v1.32.0"), this could give a different answer than the fallback path. Is raw string comparison intentional here for simplicity, or would it be worth using semver-tolerant comparison for consistency?
| ``` | ||
|
|
||
| Following fields MUST be implemented in the ControlPlane `status`. | ||
| Following fields SHOULD be implemented in the ControlPlane `status`. |
There was a problem hiding this comment.
question: Would it make sense to require that at least one of these is implemented? (It seems like the weaker language unintentionally allows providers to drop version reporting entirely, but I don't think that's the intent.)
| } | ||
|
|
||
| // StatusVersion groups version-related status information. | ||
| // +kubebuilder:validation:MinProperties=1 |
There was a problem hiding this comment.
question: Given that Version is +required, does this validation provide value? I don't think it's incorrect, but may be noise in the CRD schema.
What this PR does / why we need it:
KubeadmControlPlane.
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 #13303
P.S: I have tested the above changes locally using the docker provider. For example during upgrade