@@ -11,6 +11,7 @@ import (
1111 "github.com/openshift/installer/pkg/asset"
1212 "github.com/openshift/installer/pkg/asset/ignition/machine"
1313 "github.com/openshift/installer/pkg/asset/installconfig"
14+ icaws "github.com/openshift/installer/pkg/asset/installconfig/aws"
1415 "github.com/openshift/installer/pkg/asset/rhcos"
1516 "github.com/openshift/installer/pkg/types"
1617 awstypes "github.com/openshift/installer/pkg/types/aws"
@@ -126,36 +127,38 @@ spec:
126127 for _ , tc := range cases {
127128 t .Run (tc .name , func (t * testing.T ) {
128129 parents := asset.Parents {}
130+ cfg := & types.InstallConfig {
131+ ObjectMeta : metav1.ObjectMeta {
132+ Name : "test-cluster" ,
133+ },
134+ SSHKey : tc .key ,
135+ BaseDomain : "test-domain" ,
136+ Platform : types.Platform {
137+ AWS : & awstypes.Platform {
138+ Region : "us-east-1" ,
139+ },
140+ },
141+ Compute : []types.MachinePool {
142+ {
143+ Replicas : pointer .Int64Ptr (1 ),
144+ Hyperthreading : tc .hyperthreading ,
145+ Platform : types.MachinePoolPlatform {
146+ AWS : & awstypes.MachinePool {
147+ Zones : []string {"us-east-1a" },
148+ InstanceType : "m5.large" ,
149+ },
150+ },
151+ },
152+ },
153+ }
154+ icAsset := installconfig .MakeAsset (cfg )
155+ icAsset .AWS = icaws .NewMetadata (cfg .Platform .AWS .Region , cfg .Platform .AWS .VPC .Subnets , nil )
129156 parents .Add (
130157 & installconfig.ClusterID {
131158 UUID : "test-uuid" ,
132159 InfraID : "test-infra-id" ,
133160 },
134- installconfig .MakeAsset (
135- & types.InstallConfig {
136- ObjectMeta : metav1.ObjectMeta {
137- Name : "test-cluster" ,
138- },
139- SSHKey : tc .key ,
140- BaseDomain : "test-domain" ,
141- Platform : types.Platform {
142- AWS : & awstypes.Platform {
143- Region : "us-east-1" ,
144- },
145- },
146- Compute : []types.MachinePool {
147- {
148- Replicas : pointer .Int64Ptr (1 ),
149- Hyperthreading : tc .hyperthreading ,
150- Platform : types.MachinePoolPlatform {
151- AWS : & awstypes.MachinePool {
152- Zones : []string {"us-east-1a" },
153- InstanceType : "m5.large" ,
154- },
155- },
156- },
157- },
158- }),
161+ icAsset ,
159162 rhcos .MakeAsset ("test-image" ),
160163 (* rhcos .Release )(pointer .StringPtr ("412.86.202208101040-0" )),
161164 & machine.Worker {
@@ -183,34 +186,35 @@ spec:
183186
184187func TestComputeIsNotModified (t * testing.T ) {
185188 parents := asset.Parents {}
186- installConfig := installconfig .MakeAsset (
187- & types.InstallConfig {
188- ObjectMeta : metav1.ObjectMeta {
189- Name : "test-cluster" ,
190- },
191- SSHKey : "ssh-rsa: dummy-key" ,
192- BaseDomain : "test-domain" ,
193- Platform : types.Platform {
194- AWS : & awstypes.Platform {
195- Region : "us-east-1" ,
196- DefaultMachinePlatform : & awstypes.MachinePool {
197- InstanceType : "TEST_INSTANCE_TYPE" ,
198- },
189+ cfg := & types.InstallConfig {
190+ ObjectMeta : metav1.ObjectMeta {
191+ Name : "test-cluster" ,
192+ },
193+ SSHKey : "ssh-rsa: dummy-key" ,
194+ BaseDomain : "test-domain" ,
195+ Platform : types.Platform {
196+ AWS : & awstypes.Platform {
197+ Region : "us-east-1" ,
198+ DefaultMachinePlatform : & awstypes.MachinePool {
199+ InstanceType : "TEST_INSTANCE_TYPE" ,
199200 },
200201 },
201- Compute : []types. MachinePool {
202- {
203- Replicas : pointer . Int64Ptr ( 1 ),
204- Hyperthreading : types . HyperthreadingDisabled ,
205- Platform : types.MachinePoolPlatform {
206- AWS : & awstypes. MachinePool {
207- Zones : [] string { "us-east-1a" },
208- InstanceType : "" ,
209- } ,
202+ },
203+ Compute : []types. MachinePool {
204+ {
205+ Replicas : pointer . Int64Ptr ( 1 ) ,
206+ Hyperthreading : types .HyperthreadingDisabled ,
207+ Platform : types. MachinePoolPlatform {
208+ AWS : & awstypes. MachinePool {
209+ Zones : [] string { "us-east-1a" } ,
210+ InstanceType : "" ,
210211 },
211212 },
212213 },
213- })
214+ },
215+ }
216+ installConfig := installconfig .MakeAsset (cfg )
217+ installConfig .AWS = icaws .NewMetadata (cfg .Platform .AWS .Region , cfg .Platform .AWS .VPC .Subnets , nil )
214218
215219 parents .Add (
216220 & installconfig.ClusterID {
0 commit comments