Skip to content

Commit 10234ff

Browse files
authored
Merge pull request #5235 from serngawy/mpUpgrade
✨ Add availableUpgrades for ROSAMachinePool and update doc
2 parents dc86e24 + 1ab8377 commit 10234ff

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ spec:
221221
status:
222222
description: RosaMachinePoolStatus defines the observed state of RosaMachinePool.
223223
properties:
224+
availableUpgrades:
225+
description: Available upgrades for the ROSA MachinePool.
226+
items:
227+
type: string
228+
type: array
224229
conditions:
225230
description: Conditions defines current service state of the managed
226231
machine pool

docs/book/src/topics/rosa/upgrades.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@
44

55
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.
66

7+
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.
8+
9+
##### Note:
10+
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.
11+
12+
The available upgrades versions for the `ROSAControlPlane` will be listed under `ROSAControlPlane.status.availableUpgrades`
13+
714
The Upgrade state can be checked in the conditions under `ROSAControlPlane.status`.
815

916
## MachinePool Upgrade
1017

1118
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.
1219

20+
The available upgrades versions for the `ROSAMachinePool` will be listed under `ROSAMachinePool.status.availableUpgrades`
21+
1322
The Upgrade state can be checked in the conditions under `ROSAMachinePool.status`.
1423

15-
The version of the MachinePool can't be greater than Control Plane version.
24+
The version of the ROSAMachinePool can't be greater than its ROSAControlPlane version.

exp/api/v1beta2/rosamachinepool_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ type RosaMachinePoolStatus struct {
215215

216216
// ID is the ID given by ROSA.
217217
ID string `json:"id,omitempty"`
218+
219+
// Available upgrades for the ROSA MachinePool.
220+
AvailableUpgrades []string `json:"availableUpgrades,omitempty"`
218221
}
219222

220223
// +kubebuilder:object:root=true

exp/api/v1beta2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exp/controllers/rosamachinepool_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ func (r *ROSAMachinePoolReconciler) reconcileDelete(
323323
func (r *ROSAMachinePoolReconciler) reconcileMachinePoolVersion(machinePoolScope *scope.RosaMachinePoolScope, ocmClient *ocm.Client, nodePool *cmv1.NodePool) error {
324324
version := machinePoolScope.RosaMachinePool.Spec.Version
325325
if version == "" || version == rosa.RawVersionID(nodePool.Version()) {
326+
machinePoolScope.RosaMachinePool.Status.AvailableUpgrades = nodePool.Version().AvailableUpgrades()
326327
conditions.MarkFalse(machinePoolScope.RosaMachinePool, expinfrav1.RosaMachinePoolUpgradingCondition, "upgraded", clusterv1.ConditionSeverityInfo, "")
327328
return nil
328329
}

0 commit comments

Comments
 (0)