Skip to content

Commit 2dd867d

Browse files
committed
OCM-15096 | feat: Introduce channel-group in edit/cluster
1 parent 3bdc523 commit 2dd867d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

cmd/edit/cluster/cmd.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ var args struct {
7373
// SDN -> OVN Migration
7474
networkType string
7575
ovnInternalSubnets string
76+
77+
// Added for EUS region support
78+
channelGroup string
7679
}
7780

7881
var clusterRegistryConfigArgs *clusterregistryconfig.ClusterRegistryConfigArgs
@@ -207,6 +210,14 @@ func init() {
207210
"followed by a CIDR. \nExample: '--ovn-internal-subnets=\"join=192.168.255.0/24,transit=192.168.255.0/24,"+
208211
"masquerade=192.168.255.0/24\"'",
209212
)
213+
214+
flags.StringVar(
215+
&args.channelGroup,
216+
"channel-group",
217+
ocm.DefaultChannelGroup,
218+
"Changes the channel group used for cluster versions. "+
219+
"Channel group is the name of the channel where this image belongs, for example \"stable\" or \"eus\".",
220+
)
210221
}
211222

212223
func run(cmd *cobra.Command, _ []string) {
@@ -870,6 +881,10 @@ func run(cmd *cobra.Command, _ []string) {
870881
clusterConfig.BillingAccount = billingAccount
871882
}
872883

884+
if args.channelGroup != "" {
885+
clusterConfig.ChannelGroup = args.channelGroup
886+
}
887+
873888
r.Reporter.Debugf("Updating cluster '%s'", clusterKey)
874889
err = r.OCMClient.UpdateCluster(cluster.ID(), r.Creator, clusterConfig)
875890
if err != nil {

cmd/rosa/structure_test/command_args/rosa/edit/cluster/command_args.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
- name: billing-account
2424
- name: network-type
2525
- name: ovn-internal-subnets
26+
- name: channel-group

pkg/ocm/clusters.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,13 @@ func (c *Client) UpdateCluster(clusterKey string, creator *aws.Creator, config S
588588
clusterBuilder = clusterBuilder.ExpirationTimestamp(config.Expiration)
589589
}
590590

591+
// Update channel group
592+
if config.ChannelGroup != "" {
593+
clusterBuilder.Version(cmv1.NewVersion().
594+
ChannelGroup(config.ChannelGroup),
595+
)
596+
}
597+
591598
// Scale cluster
592599
clusterNodesBuilder, updateNodes := c.getClusterNodesBuilder(config)
593600
if updateNodes {

0 commit comments

Comments
 (0)