@@ -313,7 +313,7 @@ func TestAWSMachineReconciler(t *testing.T) {
313
313
expectedErr := errors .New ("Invalid instance" )
314
314
ec2Svc .EXPECT ().InstanceIfExists (gomock .Any ()).Return (nil , nil )
315
315
secretSvc .EXPECT ().Create (gomock .Any (), gomock .Any ()).Return ("test" , int32 (1 ), nil ).Times (1 )
316
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , expectedErr )
316
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (nil , expectedErr )
317
317
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).Times (1 )
318
318
319
319
_ , err := reconciler .reconcileNormal (context .Background (), ms , cs , cs , cs , cs )
@@ -349,7 +349,7 @@ func TestAWSMachineReconciler(t *testing.T) {
349
349
instance .State = infrav1 .InstanceStatePending
350
350
351
351
ec2Svc .EXPECT ().GetRunningInstanceByTags (gomock .Any ()).Return (nil , nil )
352
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil )
352
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil )
353
353
}
354
354
355
355
t .Run ("instance security group errors" , func (t * testing.T ) {
@@ -785,7 +785,7 @@ func TestAWSMachineReconciler(t *testing.T) {
785
785
return elbSvc
786
786
}
787
787
788
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil )
788
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil )
789
789
ec2Svc .EXPECT ().GetRunningInstanceByTags (gomock .Any ()).Return (nil , nil )
790
790
elbSvc .EXPECT ().IsInstanceRegisteredWithAPIServerELB (gomock .Any ()).Return (false , errors .New ("error describing ELB" ))
791
791
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).Times (1 )
@@ -811,7 +811,7 @@ func TestAWSMachineReconciler(t *testing.T) {
811
811
return elbSvc
812
812
}
813
813
814
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil )
814
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil )
815
815
ec2Svc .EXPECT ().GetRunningInstanceByTags (gomock .Any ()).Return (nil , nil )
816
816
elbSvc .EXPECT ().IsInstanceRegisteredWithAPIServerELB (gomock .Any ()).Return (false , nil )
817
817
elbSvc .EXPECT ().RegisterInstanceWithAPIServerELB (gomock .Any ()).Return (errors .New ("failed to attach ELB" ))
@@ -842,7 +842,7 @@ func TestAWSMachineReconciler(t *testing.T) {
842
842
ensureTag := func (t * testing.T , g * WithT ) {
843
843
t .Helper ()
844
844
ec2Svc .EXPECT ().InstanceIfExists (gomock .Any ()).Return (nil , nil )
845
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil )
845
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil )
846
846
secretSvc .EXPECT ().Create (gomock .Any (), gomock .Any ()).Return ("test" , int32 (1 ), nil )
847
847
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil )
848
848
}
@@ -888,7 +888,7 @@ func TestAWSMachineReconciler(t *testing.T) {
888
888
ensureSecurityGroups := func (t * testing.T , g * WithT ) {
889
889
t .Helper ()
890
890
ec2Svc .EXPECT ().InstanceIfExists (gomock .Any ()).Return (nil , nil )
891
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil )
891
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil )
892
892
secretSvc .EXPECT ().Create (gomock .Any (), gomock .Any ()).Return ("test" , int32 (1 ), nil )
893
893
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil )
894
894
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil )
@@ -1011,7 +1011,7 @@ func TestAWSMachineReconciler(t *testing.T) {
1011
1011
1012
1012
ec2Svc .EXPECT ().GetRunningInstanceByTags (gomock .Any ()).Return (nil , nil ).AnyTimes ()
1013
1013
secretSvc .EXPECT ().Create (gomock .Any (), gomock .Any ()).Return (secretPrefix , int32 (1 ), nil ).Times (1 )
1014
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil ).AnyTimes ()
1014
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil ).AnyTimes ()
1015
1015
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).Times (1 )
1016
1016
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil ).Times (1 )
1017
1017
ec2Svc .EXPECT ().GetCoreSecurityGroups (gomock .Any ()).Return ([]string {}, nil ).Times (1 )
@@ -1048,7 +1048,7 @@ func TestAWSMachineReconciler(t *testing.T) {
1048
1048
1049
1049
ec2Svc .EXPECT ().GetRunningInstanceByTags (gomock .Any ()).Return (nil , nil ).AnyTimes ()
1050
1050
secretSvc .EXPECT ().Create (gomock .Any (), gomock .Any ()).Return (secretPrefix , int32 (1 ), nil ).Times (1 )
1051
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil ).AnyTimes ()
1051
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil ).AnyTimes ()
1052
1052
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).Times (1 )
1053
1053
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil ).Times (1 )
1054
1054
ec2Svc .EXPECT ().GetCoreSecurityGroups (gomock .Any ()).Return ([]string {}, nil ).Times (1 )
@@ -1304,7 +1304,7 @@ func TestAWSMachineReconciler(t *testing.T) {
1304
1304
}
1305
1305
instance .State = infrav1 .InstanceStatePending
1306
1306
secretSvc .EXPECT ().Create (gomock .Any (), gomock .Any ()).Return (secretPrefix , int32 (1 ), nil ).Times (1 )
1307
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil ).AnyTimes ()
1307
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil ).AnyTimes ()
1308
1308
secretSvc .EXPECT ().UserData (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).Times (1 )
1309
1309
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil ).Times (1 )
1310
1310
ec2Svc .EXPECT ().GetCoreSecurityGroups (gomock .Any ()).Return ([]string {}, nil ).Times (1 )
@@ -1357,7 +1357,7 @@ func TestAWSMachineReconciler(t *testing.T) {
1357
1357
fakeS3URL := "s3://foo"
1358
1358
1359
1359
objectStoreSvc .EXPECT ().Create (gomock .Any (), gomock .Any (), gomock .Any ()).Return (fakeS3URL , nil ).Times (1 )
1360
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil ).AnyTimes ()
1360
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil ).AnyTimes ()
1361
1361
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil ).Times (1 )
1362
1362
ec2Svc .EXPECT ().GetCoreSecurityGroups (gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1363
1363
ec2Svc .EXPECT ().GetAdditionalSecurityGroupsIDs (gomock .Any ()).Return (nil , nil )
@@ -1392,7 +1392,7 @@ func TestAWSMachineReconciler(t *testing.T) {
1392
1392
presigned := "https://cluster-api-aws.s3.us-west-2.amazonaws.com/bootstrap-data.yaml?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3SGQVQG7FGA6KKA6%2F20221104%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20221104T140227Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55"
1393
1393
1394
1394
objectStoreSvc .EXPECT ().Create (gomock .Any (), gomock .Any (), gomock .Any ()).Return (presigned , nil ).Times (1 )
1395
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil ).AnyTimes ()
1395
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil ).AnyTimes ()
1396
1396
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil ).Times (1 )
1397
1397
ec2Svc .EXPECT ().GetCoreSecurityGroups (gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1398
1398
ec2Svc .EXPECT ().GetAdditionalSecurityGroupsIDs (gomock .Any ()).Return (nil , nil )
@@ -1611,7 +1611,7 @@ func TestAWSMachineReconciler(t *testing.T) {
1611
1611
// Expect no Cluster Object Store to be created.
1612
1612
objectStoreSvc .EXPECT ().Create (gomock .Any (), gomock .Any (), gomock .Any ()).Return (fakeS3URL , nil ).Times (0 )
1613
1613
1614
- ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any ()).Return (instance , nil ).AnyTimes ()
1614
+ ec2Svc .EXPECT ().CreateInstance (gomock .Any (), gomock .Any (), gomock .Any (), gomock . Any () ).Return (instance , nil ).AnyTimes ()
1615
1615
ec2Svc .EXPECT ().GetInstanceSecurityGroups (gomock .Any ()).Return (map [string ][]string {"eid" : {}}, nil ).Times (1 )
1616
1616
ec2Svc .EXPECT ().GetCoreSecurityGroups (gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1617
1617
ec2Svc .EXPECT ().GetAdditionalSecurityGroupsIDs (gomock .Any ()).Return (nil , nil )
0 commit comments