diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml index 919e21118c..d094f0a327 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml @@ -221,6 +221,11 @@ spec: status: description: RosaMachinePoolStatus defines the observed state of RosaMachinePool. properties: + availableUpgrades: + description: Available upgrades for the ROSA MachinePool. + items: + type: string + type: array conditions: description: Conditions defines current service state of the managed machine pool diff --git a/docs/book/src/topics/rosa/upgrades.md b/docs/book/src/topics/rosa/upgrades.md index bcf6c22ff7..76e56cddad 100644 --- a/docs/book/src/topics/rosa/upgrades.md +++ b/docs/book/src/topics/rosa/upgrades.md @@ -4,12 +4,21 @@ Upgrading the OpenShift version of the control plane is supported by the provider. To perform an upgrade you need to update the `version` in the spec of the `ROSAControlPlane`. Once the version has changed the provider will handle the upgrade for you. +Upgrading y-stream version ex; v4.16.x to v4.17.x required the version gate acknowledgement. By default the versionGate is set to WaitForAcknowledge in the `ROSAControlPlane` CR. When upgrading to y-stream version the versionGate should be set to Acknowledge or AlwaysAcknowledge. + +##### Note: +When the versionGate is set to 'Acknowledge', it will revert to 'WaitForAcknowledge' once the upgrade is successfully completed. However, if the versionGate is set to 'AlwaysAcknowledge', it will remain set to 'AlwaysAcknowledge' after the upgrade is successfully completed. + +The available upgrades versions for the `ROSAControlPlane` will be listed under `ROSAControlPlane.status.availableUpgrades` + The Upgrade state can be checked in the conditions under `ROSAControlPlane.status`. ## MachinePool Upgrade Upgrading the OpenShift version of the MachinePools is supported by the provider and can be performed independetly from the Control Plane upgrades. To perform an upgrade you need to update the `version` in the spec of the `ROSAMachinePool`. Once the version has changed the provider will handle the upgrade for you. +The available upgrades versions for the `ROSAMachinePool` will be listed under `ROSAMachinePool.status.availableUpgrades` + The Upgrade state can be checked in the conditions under `ROSAMachinePool.status`. -The version of the MachinePool can't be greater than Control Plane version. +The version of the ROSAMachinePool can't be greater than its ROSAControlPlane version. diff --git a/exp/api/v1beta2/rosamachinepool_types.go b/exp/api/v1beta2/rosamachinepool_types.go index 3b591dde65..ae63ca4f18 100644 --- a/exp/api/v1beta2/rosamachinepool_types.go +++ b/exp/api/v1beta2/rosamachinepool_types.go @@ -215,6 +215,9 @@ type RosaMachinePoolStatus struct { // ID is the ID given by ROSA. ID string `json:"id,omitempty"` + + // Available upgrades for the ROSA MachinePool. + AvailableUpgrades []string `json:"availableUpgrades,omitempty"` } // +kubebuilder:object:root=true diff --git a/exp/api/v1beta2/zz_generated.deepcopy.go b/exp/api/v1beta2/zz_generated.deepcopy.go index f34e8f9d9b..c8131307ab 100644 --- a/exp/api/v1beta2/zz_generated.deepcopy.go +++ b/exp/api/v1beta2/zz_generated.deepcopy.go @@ -1198,6 +1198,11 @@ func (in *RosaMachinePoolStatus) DeepCopyInto(out *RosaMachinePoolStatus) { *out = new(string) **out = **in } + if in.AvailableUpgrades != nil { + in, out := &in.AvailableUpgrades, &out.AvailableUpgrades + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaMachinePoolStatus. diff --git a/exp/controllers/rosamachinepool_controller.go b/exp/controllers/rosamachinepool_controller.go index 41a8f15848..de3c235724 100644 --- a/exp/controllers/rosamachinepool_controller.go +++ b/exp/controllers/rosamachinepool_controller.go @@ -323,6 +323,7 @@ func (r *ROSAMachinePoolReconciler) reconcileDelete( func (r *ROSAMachinePoolReconciler) reconcileMachinePoolVersion(machinePoolScope *scope.RosaMachinePoolScope, ocmClient *ocm.Client, nodePool *cmv1.NodePool) error { version := machinePoolScope.RosaMachinePool.Spec.Version if version == "" || version == rosa.RawVersionID(nodePool.Version()) { + machinePoolScope.RosaMachinePool.Status.AvailableUpgrades = nodePool.Version().AvailableUpgrades() conditions.MarkFalse(machinePoolScope.RosaMachinePool, expinfrav1.RosaMachinePoolUpgradingCondition, "upgraded", clusterv1.ConditionSeverityInfo, "") return nil }