rancher-sandbox / cluster-api-provider-rke2

RKE2 bootstrap and control-plane Cluster API providers.
Apache License 2.0
78 stars 24 forks source link

Use spec.Version field as primarily source #306

Closed alexander-demicev closed 2 months ago

alexander-demicev commented 2 months ago

What this PR does / why we need it:

Use spec.Version field as primarily source of RKE2 version. Currently, it's just a placeholder for satisfying API contracts. When both spec.AgentConfig.Version and spec.Version are specified, spec.Version take precedence.

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:

Checklist:

alexander-demicev commented 2 months ago

@Danil-Grigorev this should stay a valid option, I don't want to deprecate a feature for users without notice. We can make it only possible place to specify version in future releases.

alexander-demicev commented 2 months ago

@richardcase The Current upgrade test covers transition from the old version field to new one and then also upgrades the cluster with it

alexander-demicev commented 2 months ago

@Danil-Grigorev I'm not following your concern. It is possible to set different versions for the control plane and workers, I don't see how it's related to this PR and users can choose if they want to set version by setting RKE2ControlPlane.Spec.Version or RKE2ControlPlane.Spec.AgentConfig.Version for control plane and MachineDeployment.Spec.Template.Version or RKE2ConfigTemplate.AgentConfig.Version for workers. We shouldn't remove existing functionality without any notice, we'll have to support both option for some time.