@@ -106,11 +106,13 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
106106			g .Expect (testEnv .Cleanup (ctx , awsMachine , ns , secret )).To (Succeed ())
107107		})
108108
109- 		cs , err  :=  getClusterScope (infrav1.AWSCluster {ObjectMeta : metav1.ObjectMeta {Name : "test" }, Spec : infrav1.AWSClusterSpec {NetworkSpec : infrav1.NetworkSpec {Subnets : []infrav1.SubnetSpec {
110- 			{
111- 				ID :               "subnet-1" ,
112- 				AvailabilityZone : "us-east-1a" ,
113- 			}},
109+ 		cs , err  :=  getClusterScope (infrav1.AWSCluster {ObjectMeta : metav1.ObjectMeta {Name : "test" }, Spec : infrav1.AWSClusterSpec {NetworkSpec : infrav1.NetworkSpec {
110+ 			Subnets : []infrav1.SubnetSpec {
111+ 				{
112+ 					ID :               "subnet-1" ,
113+ 					AvailabilityZone : "us-east-1a" ,
114+ 				},
115+ 			},
114116		}}})
115117		g .Expect (err ).To (BeNil ())
116118		cs .Cluster  =  & clusterv1.Cluster {ObjectMeta : metav1.ObjectMeta {Name : "test-cluster" }}
@@ -131,7 +133,8 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
131133			},
132134			infrav1 .SecurityGroupControlPlane : {
133135				ID : "3" ,
134- 			}}
136+ 			},
137+ 		}
135138		ms , err  :=  getMachineScope (cs , awsMachine )
136139		g .Expect (err ).To (BeNil ())
137140
@@ -162,9 +165,11 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
162165
163166		_ , err  =  reconciler .reconcileNormal (ctx , ms , cs , cs , cs , cs )
164167		g .Expect (err ).To (BeNil ())
165- 		expectConditions (g , ms .AWSMachine , []conditionAssertion {{infrav1 .SecurityGroupsReadyCondition , corev1 .ConditionTrue , "" , "" },
168+ 		expectConditions (g , ms .AWSMachine , []conditionAssertion {
169+ 			{infrav1 .SecurityGroupsReadyCondition , corev1 .ConditionTrue , "" , "" },
166170			{infrav1 .InstanceReadyCondition , corev1 .ConditionTrue , "" , "" },
167- 			{infrav1 .ELBAttachedCondition , corev1 .ConditionTrue , "" , "" }})
171+ 			{infrav1 .ELBAttachedCondition , corev1 .ConditionTrue , "" , "" },
172+ 		})
168173		g .Expect (ms .AWSMachine .Finalizers ).Should (ContainElement (infrav1 .MachineFinalizer ))
169174	})
170175	t .Run ("Should successfully reconcile control plane machine deletion" , func (t  * testing.T ) {
@@ -236,7 +241,8 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
236241		g .Expect (err ).To (BeNil ())
237242		expectConditions (g , ms .AWSMachine , []conditionAssertion {
238243			{infrav1 .InstanceReadyCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityInfo , clusterv1 .DeletedReason },
239- 			{infrav1 .ELBAttachedCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityInfo , clusterv1 .DeletedReason }})
244+ 			{infrav1 .ELBAttachedCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityInfo , clusterv1 .DeletedReason },
245+ 		})
240246		g .Expect (ms .AWSMachine .Finalizers ).ShouldNot (ContainElement (infrav1 .MachineFinalizer ))
241247	})
242248	t .Run ("Should fail reconciling control-plane machine creation while attaching load balancer" , func (t  * testing.T ) {
@@ -280,11 +286,13 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
280286			g .Expect (testEnv .Cleanup (ctx , awsMachine , ns , secret )).To (Succeed ())
281287		})
282288
283- 		cs , err  :=  getClusterScope (infrav1.AWSCluster {ObjectMeta : metav1.ObjectMeta {Name : "test" }, Spec : infrav1.AWSClusterSpec {NetworkSpec : infrav1.NetworkSpec {Subnets : []infrav1.SubnetSpec {
284- 			{
285- 				ID :               "subnet-1" ,
286- 				AvailabilityZone : "us-east-1a" ,
287- 			}},
289+ 		cs , err  :=  getClusterScope (infrav1.AWSCluster {ObjectMeta : metav1.ObjectMeta {Name : "test" }, Spec : infrav1.AWSClusterSpec {NetworkSpec : infrav1.NetworkSpec {
290+ 			Subnets : []infrav1.SubnetSpec {
291+ 				{
292+ 					ID :               "subnet-1" ,
293+ 					AvailabilityZone : "us-east-1a" ,
294+ 				},
295+ 			},
288296		}}})
289297		g .Expect (err ).To (BeNil ())
290298		cs .Cluster  =  & clusterv1.Cluster {ObjectMeta : metav1.ObjectMeta {Name : "test-cluster" }}
@@ -305,7 +313,8 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
305313			},
306314			infrav1 .SecurityGroupControlPlane : {
307315				ID : "3" ,
308- 			}}
316+ 			},
317+ 		}
309318		ms , err  :=  getMachineScope (cs , awsMachine )
310319		g .Expect (err ).To (BeNil ())
311320
@@ -411,8 +420,10 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
411420
412421		_ , err  =  reconciler .reconcileDelete (ms , cs , cs , cs , cs )
413422		g .Expect (err ).Should (HaveOccurred ())
414- 		expectConditions (g , ms .AWSMachine , []conditionAssertion {{infrav1 .InstanceReadyCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityWarning , "DeletingFailed" },
415- 			{infrav1 .ELBAttachedCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityInfo , clusterv1 .DeletedReason }})
423+ 		expectConditions (g , ms .AWSMachine , []conditionAssertion {
424+ 			{infrav1 .InstanceReadyCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityWarning , "DeletingFailed" },
425+ 			{infrav1 .ELBAttachedCondition , corev1 .ConditionFalse , clusterv1 .ConditionSeverityInfo , clusterv1 .DeletedReason },
426+ 		})
416427		g .Expect (ms .AWSMachine .Finalizers ).ShouldNot (ContainElement (infrav1 .MachineFinalizer ))
417428	})
418429}
@@ -572,11 +583,11 @@ func mockedCreateInstanceCalls(m *mocks.MockEC2APIMockRecorder) {
572583		Filters : []* ec2.Filter {
573584			{
574585				Name :   aws .String ("owner-id" ),
575- 				Values : aws .StringSlice ([]string {"258751437250 " }),
586+ 				Values : aws .StringSlice ([]string {"819546954734 " }),
576587			},
577588			{
578589				Name :   aws .String ("name" ),
579- 				Values : aws .StringSlice ([]string {"capa-ami-ubuntu-18 .04-?test-*" }),
590+ 				Values : aws .StringSlice ([]string {"capa-ami-ubuntu-24 .04-?test-*" }),
580591			},
581592			{
582593				Name :   aws .String ("architecture" ),
@@ -590,7 +601,8 @@ func mockedCreateInstanceCalls(m *mocks.MockEC2APIMockRecorder) {
590601				Name :   aws .String ("virtualization-type" ),
591602				Values : aws .StringSlice ([]string {"hvm" }),
592603			},
593- 		}})).Return (& ec2.DescribeImagesOutput {Images : []* ec2.Image {
604+ 		},
605+ 	})).Return (& ec2.DescribeImagesOutput {Images : []* ec2.Image {
594606		{
595607			ImageId :      aws .String ("latest" ),
596608			CreationDate : aws .String ("2019-02-08T17:02:31.000Z" ),
@@ -639,7 +651,8 @@ func mockedCreateInstanceCalls(m *mocks.MockEC2APIMockRecorder) {
639651					},
640652				},
641653			},
642- 		}}, nil ).MaxTimes (3 )
654+ 		},
655+ 	}, nil ).MaxTimes (3 )
643656	m .DescribeNetworkInterfaceAttributeWithContext (context .TODO (), gomock .Eq (& ec2.DescribeNetworkInterfaceAttributeInput {
644657		NetworkInterfaceId : aws .String ("eni-1" ),
645658		Attribute :          aws .String ("groupSet" ),
0 commit comments