@@ -106,11 +106,13 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
106
106
g .Expect (testEnv .Cleanup (ctx , awsMachine , ns , secret )).To (Succeed ())
107
107
})
108
108
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
+ },
114
116
}}})
115
117
g .Expect (err ).To (BeNil ())
116
118
cs .Cluster = & clusterv1.Cluster {ObjectMeta : metav1.ObjectMeta {Name : "test-cluster" }}
@@ -131,7 +133,8 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
131
133
},
132
134
infrav1 .SecurityGroupControlPlane : {
133
135
ID : "3" ,
134
- }}
136
+ },
137
+ }
135
138
ms , err := getMachineScope (cs , awsMachine )
136
139
g .Expect (err ).To (BeNil ())
137
140
@@ -162,9 +165,11 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
162
165
163
166
_ , err = reconciler .reconcileNormal (ctx , ms , cs , cs , cs , cs )
164
167
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 , "" , "" },
166
170
{infrav1 .InstanceReadyCondition , corev1 .ConditionTrue , "" , "" },
167
- {infrav1 .ELBAttachedCondition , corev1 .ConditionTrue , "" , "" }})
171
+ {infrav1 .ELBAttachedCondition , corev1 .ConditionTrue , "" , "" },
172
+ })
168
173
g .Expect (ms .AWSMachine .Finalizers ).Should (ContainElement (infrav1 .MachineFinalizer ))
169
174
})
170
175
t .Run ("Should successfully reconcile control plane machine deletion" , func (t * testing.T ) {
@@ -236,7 +241,8 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
236
241
g .Expect (err ).To (BeNil ())
237
242
expectConditions (g , ms .AWSMachine , []conditionAssertion {
238
243
{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
+ })
240
246
g .Expect (ms .AWSMachine .Finalizers ).ShouldNot (ContainElement (infrav1 .MachineFinalizer ))
241
247
})
242
248
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) {
280
286
g .Expect (testEnv .Cleanup (ctx , awsMachine , ns , secret )).To (Succeed ())
281
287
})
282
288
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
+ },
288
296
}}})
289
297
g .Expect (err ).To (BeNil ())
290
298
cs .Cluster = & clusterv1.Cluster {ObjectMeta : metav1.ObjectMeta {Name : "test-cluster" }}
@@ -305,7 +313,8 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
305
313
},
306
314
infrav1 .SecurityGroupControlPlane : {
307
315
ID : "3" ,
308
- }}
316
+ },
317
+ }
309
318
ms , err := getMachineScope (cs , awsMachine )
310
319
g .Expect (err ).To (BeNil ())
311
320
@@ -411,8 +420,10 @@ func TestAWSMachineReconcilerIntegrationTests(t *testing.T) {
411
420
412
421
_ , err = reconciler .reconcileDelete (ms , cs , cs , cs , cs )
413
422
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
+ })
416
427
g .Expect (ms .AWSMachine .Finalizers ).ShouldNot (ContainElement (infrav1 .MachineFinalizer ))
417
428
})
418
429
}
@@ -572,11 +583,11 @@ func mockedCreateInstanceCalls(m *mocks.MockEC2APIMockRecorder) {
572
583
Filters : []* ec2.Filter {
573
584
{
574
585
Name : aws .String ("owner-id" ),
575
- Values : aws .StringSlice ([]string {"258751437250 " }),
586
+ Values : aws .StringSlice ([]string {"819546954734 " }),
576
587
},
577
588
{
578
589
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-*" }),
580
591
},
581
592
{
582
593
Name : aws .String ("architecture" ),
@@ -590,7 +601,8 @@ func mockedCreateInstanceCalls(m *mocks.MockEC2APIMockRecorder) {
590
601
Name : aws .String ("virtualization-type" ),
591
602
Values : aws .StringSlice ([]string {"hvm" }),
592
603
},
593
- }})).Return (& ec2.DescribeImagesOutput {Images : []* ec2.Image {
604
+ },
605
+ })).Return (& ec2.DescribeImagesOutput {Images : []* ec2.Image {
594
606
{
595
607
ImageId : aws .String ("latest" ),
596
608
CreationDate : aws .String ("2019-02-08T17:02:31.000Z" ),
@@ -639,7 +651,8 @@ func mockedCreateInstanceCalls(m *mocks.MockEC2APIMockRecorder) {
639
651
},
640
652
},
641
653
},
642
- }}, nil ).MaxTimes (3 )
654
+ },
655
+ }, nil ).MaxTimes (3 )
643
656
m .DescribeNetworkInterfaceAttributeWithContext (context .TODO (), gomock .Eq (& ec2.DescribeNetworkInterfaceAttributeInput {
644
657
NetworkInterfaceId : aws .String ("eni-1" ),
645
658
Attribute : aws .String ("groupSet" ),
0 commit comments