diff --git a/machines/aws/worker.machineset.yaml b/machines/aws/worker.machineset.yaml index 32ca9c183d..4a3630cbb2 100644 --- a/machines/aws/worker.machineset.yaml +++ b/machines/aws/worker.machineset.yaml @@ -45,7 +45,7 @@ spec: - name: "owner-id" values: - "595879546273" - instanceType: m4.large + instanceType: {{.AWS.InstanceType}} placement: region: {{.AWS.Region}} availabilityZone: {{.AWS.AvailabilityZone}} diff --git a/pkg/render/config.go b/pkg/render/config.go index 21d42eec56..8d27504e58 100644 --- a/pkg/render/config.go +++ b/pkg/render/config.go @@ -40,6 +40,7 @@ type AWSConfig struct { ContainerLinuxVersion string `json:"containerLinuxVersion"` Replicas string `json:"replicas"` WithCreds bool `json:"withCreds"` + InstanceType string `json:"instanceType"` } // Images allows build systems to inject images for MAO components. diff --git a/pkg/render/render_test.go b/pkg/render/render_test.go index 93056689a0..aef7832cf3 100644 --- a/pkg/render/render_test.go +++ b/pkg/render/render_test.go @@ -38,11 +38,11 @@ func TestClusterAWSManifest(t *testing.T) { TargetNamespace: "go-test", Provider: "AWS", AWS: &AWSConfig{ - ClusterName: "TestClusterManifest-ClusterName", - ClusterID: "TestClusterManifest-ClusterID", - Region: "TestClusterManifest-Region", AvailabilityZone: "TestClusterManifest-AvailabilityZone", + ClusterID: "TestClusterManifest-ClusterID", + ClusterName: "TestClusterManifest-ClusterName", Image: "TestClusterManifest-Image", + Region: "TestClusterManifest-Region", Replicas: "TestClusterManifest-Replicas", }, } @@ -71,14 +71,15 @@ func TestMachineSetAWSManifest(t *testing.T) { TargetNamespace: "go-test", Provider: "aws", AWS: &AWSConfig{ - ClusterName: "TestClusterManifest-ClusterName", + AvailabilityZone: "TestClusterManifest-AvailabilityZone", ClusterID: "TestClusterManifest-ClusterID", - ReleaseChannel: "TestChannel", + ClusterName: "TestClusterManifest-ClusterName", ContainerLinuxVersion: "TestCLVersion", - Region: "TestClusterManifest-Region", - AvailabilityZone: "TestClusterManifest-AvailabilityZone", - Image: "TestClusterManifest-Image", - Replicas: "TestClusterManifest-Replicas", + Image: "TestClusterManifest-Image", + InstanceType: "TestClusterManifest-InstanceType", + Region: "TestClusterManifest-Region", + ReleaseChannel: "TestChannel", + Replicas: "TestClusterManifest-Replicas", }, } @@ -126,7 +127,7 @@ spec: - name: "owner-id" values: - "595879546273" - instanceType: m4.large + instanceType: TestClusterManifest-InstanceType placement: region: TestClusterManifest-Region availabilityZone: TestClusterManifest-AvailabilityZone diff --git a/tests/e2e/main.go b/tests/e2e/main.go index 0885a87d60..f7d5e393a0 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -39,6 +39,7 @@ const ( targetNamespace = "openshift-cluster-api" awsCredentialsSecretName = "aws-credentials-secret" region = "us-east-1" + instanceType = "m4.large" machineSetReplicas = 2 ) @@ -258,9 +259,10 @@ var rootCmd = &cobra.Command{ } configValues := &render.OperatorConfig{ AWS: &render.AWSConfig{ - ClusterID: clusterID, - ClusterName: clusterID, - Region: region, + ClusterID: clusterID, + ClusterName: clusterID, + Region: region, + InstanceType: instanceType, }, } maoConfigPopulatedData, err := render.Manifests(configValues, maoConfigTemplateData) diff --git a/tests/e2e/manifests/mao-config.yaml b/tests/e2e/manifests/mao-config.yaml index 306a1ff27d..ebaa163508 100644 --- a/tests/e2e/manifests/mao-config.yaml +++ b/tests/e2e/manifests/mao-config.yaml @@ -6,6 +6,7 @@ aws: containerLinuxVersion: 1800.7.0 image: "" region: {{.AWS.Region}} + instanceType: {{.AWS.InstanceType}} releaseChannel: stable replicas: 2 WithCreds: true