Skip to content

Commit 61ad0ec

Browse files
committed
SLSRE-371 | feat: add hidden options for setting master/infra machine types with rosa create cluster
1 parent 8e3f280 commit 61ad0ec

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

cmd/create/cluster/cmd.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ var args struct {
257257
allowedRegistriesForImport string
258258
platformAllowlist string
259259
additionalTrustedCa string
260+
261+
// Master / Infra Machine Config
262+
masterMachineType string
263+
infraMachineType string
260264
}
261265

262266
var clusterRegistryConfigArgs *clusterregistryconfig.ClusterRegistryConfigArgs
@@ -929,6 +933,22 @@ func initFlags(cmd *cobra.Command) {
929933
listInputMessage,
930934
)
931935

936+
flags.StringVar(
937+
&args.masterMachineType,
938+
"master-machine-type",
939+
"",
940+
"Instance type for the Master nodes",
941+
)
942+
_ = flags.MarkHidden("master-machine-type")
943+
944+
flags.StringVar(
945+
&args.infraMachineType,
946+
"infra-machine-type",
947+
"",
948+
"Instance type for the Infra nodes",
949+
)
950+
_ = flags.MarkHidden("infra-machine-type")
951+
932952
interactive.AddModeFlag(cmd)
933953
interactive.AddFlag(flags)
934954
output.AddFlag(cmd)
@@ -3389,6 +3409,8 @@ func run(cmd *cobra.Command, _ []string) {
33893409
AdditionalInfraSecurityGroupIds: additionalInfraSecurityGroupIds,
33903410
AdditionalControlPlaneSecurityGroupIds: additionalControlPlaneSecurityGroupIds,
33913411
AdditionalAllowedPrincipals: additionalAllowedPrincipals,
3412+
MasterMachineType: args.masterMachineType,
3413+
InfraMachineType: args.infraMachineType,
33923414
}
33933415

33943416
if httpTokens != "" {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,5 @@
111111
- name: interactive
112112
- name: output
113113
- name: "yes"
114+
- name: master-machine-type
115+
- name: infra-machine-type

pkg/ocm/clusters.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ type Spec struct {
191191
PlatformAllowlist string
192192
AdditionalTrustedCaFile string
193193
AdditionalTrustedCa map[string]string
194+
195+
// Master/Infra Machine Config
196+
MasterMachineType string
197+
InfraMachineType string
194198
}
195199

196200
// Volume represents a volume property for a disk
@@ -925,6 +929,12 @@ func (c *Client) createClusterSpec(config Spec) (*cmv1.Cluster, error) {
925929
if len(config.ComputeLabels) > 0 {
926930
clusterNodesBuilder = clusterNodesBuilder.ComputeLabels(config.ComputeLabels)
927931
}
932+
if config.MasterMachineType != "" {
933+
clusterNodesBuilder.MasterMachineType(cmv1.NewMachineType().ID(config.MasterMachineType))
934+
}
935+
if config.InfraMachineType != "" {
936+
clusterNodesBuilder.InfraMachineType(cmv1.NewMachineType().ID(config.InfraMachineType))
937+
}
928938
clusterBuilder = clusterBuilder.Nodes(clusterNodesBuilder)
929939
}
930940

0 commit comments

Comments
 (0)