Skip to content

Commit 2293c88

Browse files
authored
Merge pull request #5279 from serngawy/vChannelG
✨ ROSA: Add version channel Group
2 parents 9768ab4 + 11a75da commit 2293c88

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ spec:
8282
rule: self == oldSelf
8383
- message: billingAccount must be a valid AWS account ID
8484
rule: self.matches('^[0-9]{12}$')
85+
channelGroup:
86+
default: stable
87+
description: OpenShift version channel group, default is stable.
88+
enum:
89+
- stable
90+
- candidate
91+
- nightly
92+
type: string
8593
clusterRegistryConfig:
8694
description: ClusterRegistryConfig represents registry config used
8795
with the cluster.
@@ -800,6 +808,7 @@ spec:
800808
type: string
801809
required:
802810
- availabilityZones
811+
- channelGroup
803812
- installerRoleARN
804813
- oidcID
805814
- region

controlplane/rosa/api/v1beta2/rosacontrolplane_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ type RosaControlPlaneSpec struct { //nolint: maligned
9191
// OpenShift semantic version, for example "4.14.5".
9292
Version string `json:"version"`
9393

94+
// OpenShift version channel group, default is stable.
95+
//
96+
// +kubebuilder:validation:Enum=stable;candidate;nightly
97+
// +kubebuilder:default=stable
98+
ChannelGroup string `json:"channelGroup"`
99+
94100
// VersionGate requires acknowledgment when upgrading ROSA-HCP y-stream versions (e.g., from 4.15 to 4.16).
95101
// Default is WaitForAcknowledge.
96102
// WaitForAcknowledge: If acknowledgment is required, the upgrade will not proceed until VersionGate is set to Acknowledge or AlwaysAcknowledge.

controlplane/rosa/controllers/rosacontrolplane_controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,8 @@ func (r *ROSAControlPlaneReconciler) reconcileClusterAdminPassword(ctx context.C
878878

879879
func validateControlPlaneSpec(ocmClient *ocm.Client, rosaScope *scope.ROSAControlPlaneScope) (string, error) {
880880
version := rosaScope.ControlPlane.Spec.Version
881-
valid, err := ocmClient.ValidateHypershiftVersion(version, ocm.DefaultChannelGroup)
881+
channelGroup := rosaScope.ControlPlane.Spec.ChannelGroup
882+
valid, err := ocmClient.ValidateHypershiftVersion(version, channelGroup)
882883
if err != nil {
883884
return "", fmt.Errorf("failed to check if version is valid: %w", err)
884885
}
@@ -902,8 +903,8 @@ func buildOCMClusterSpec(controlPlaneSpec rosacontrolplanev1.RosaControlPlaneSpe
902903
DomainPrefix: controlPlaneSpec.DomainPrefix,
903904
Region: controlPlaneSpec.Region,
904905
MultiAZ: true,
905-
Version: ocm.CreateVersionID(controlPlaneSpec.Version, ocm.DefaultChannelGroup),
906-
ChannelGroup: ocm.DefaultChannelGroup,
906+
Version: ocm.CreateVersionID(controlPlaneSpec.Version, controlPlaneSpec.ChannelGroup),
907+
ChannelGroup: controlPlaneSpec.ChannelGroup,
907908
DisableWorkloadMonitoring: ptr.To(true),
908909
DefaultIngress: ocm.NewDefaultIngressSpec(), // n.b. this is a no-op when it's set to the default value
909910
ComputeMachineType: controlPlaneSpec.DefaultMachinePoolSpec.InstanceType,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ When the versionGate is set to 'Acknowledge', it will revert to 'WaitForAcknowle
1111

1212
The available upgrades versions for the `ROSAControlPlane` will be listed under `ROSAControlPlane.status.availableUpgrades`
1313

14+
The version channel group `ROSAControlPlane.spec.channelGroup` default to stable. However, it can be set to candidate or nightly. Changing the version channel group will change the `ROSAControlPlane.status.availableUpgrades` accordingly.
15+
1416
The Upgrade state can be checked in the conditions under `ROSAControlPlane.status`.
1517

1618
## MachinePool Upgrade

0 commit comments

Comments
 (0)