@@ -425,7 +425,7 @@ func TestAWSClusterReconcilerIntegrationTests(t *testing.T) {
425
425
}
426
426
427
427
func mockedDeleteSGCalls (m * mocks.MockEC2APIMockRecorder ) {
428
- m .DescribeSecurityGroupsPages ( gomock .Any (), gomock .Any ()).Return (nil )
428
+ m .DescribeSecurityGroupsPagesWithContext ( context . TODO (), gomock .Any (), gomock .Any ()).Return (nil )
429
429
}
430
430
431
431
func createControllerIdentity (g * WithT ) * infrav1.AWSClusterControllerIdentity {
@@ -447,7 +447,7 @@ func createControllerIdentity(g *WithT) *infrav1.AWSClusterControllerIdentity {
447
447
}
448
448
449
449
func mockedDescribeInstanceCall (m * mocks.MockEC2APIMockRecorder ) {
450
- m .DescribeInstances ( gomock .Eq (& ec2.DescribeInstancesInput {
450
+ m .DescribeInstancesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeInstancesInput {
451
451
Filters : []* ec2.Filter {
452
452
{
453
453
Name : aws .String ("tag:sigs.k8s.io/cluster-api-provider-aws/role" ),
@@ -498,28 +498,28 @@ func mockedDescribeInstanceCall(m *mocks.MockEC2APIMockRecorder) {
498
498
}
499
499
500
500
func mockedDeleteInstanceAndAwaitTerminationCalls (m * mocks.MockEC2APIMockRecorder ) {
501
- m .TerminateInstances (
501
+ m .TerminateInstancesWithContext ( context . TODO (),
502
502
gomock .Eq (& ec2.TerminateInstancesInput {
503
503
InstanceIds : aws .StringSlice ([]string {"id-1" }),
504
504
}),
505
505
).Return (nil , nil )
506
- m .WaitUntilInstanceTerminated (
506
+ m .WaitUntilInstanceTerminatedWithContext ( context . TODO (),
507
507
gomock .Eq (& ec2.DescribeInstancesInput {
508
508
InstanceIds : aws .StringSlice ([]string {"id-1" }),
509
509
}),
510
510
).Return (nil )
511
511
}
512
512
513
513
func mockedDeleteInstanceCalls (m * mocks.MockEC2APIMockRecorder ) {
514
- m .TerminateInstances (
514
+ m .TerminateInstancesWithContext ( context . TODO (),
515
515
gomock .Eq (& ec2.TerminateInstancesInput {
516
516
InstanceIds : aws .StringSlice ([]string {"id-1" }),
517
517
}),
518
518
).Return (nil , nil )
519
519
}
520
520
521
521
func mockedCreateVPCCalls (m * mocks.MockEC2APIMockRecorder ) {
522
- m .CreateTags ( gomock .Eq (& ec2.CreateTagsInput {
522
+ m .CreateTagsWithContext ( context . TODO (), gomock .Eq (& ec2.CreateTagsInput {
523
523
Resources : aws .StringSlice ([]string {"subnet-1" }),
524
524
Tags : []* ec2.Tag {
525
525
{
@@ -532,7 +532,7 @@ func mockedCreateVPCCalls(m *mocks.MockEC2APIMockRecorder) {
532
532
},
533
533
},
534
534
})).Return (& ec2.CreateTagsOutput {}, nil )
535
- m .CreateTags ( gomock .Eq (& ec2.CreateTagsInput {
535
+ m .CreateTagsWithContext ( context . TODO (), gomock .Eq (& ec2.CreateTagsInput {
536
536
Resources : aws .StringSlice ([]string {"subnet-2" }),
537
537
Tags : []* ec2.Tag {
538
538
{
@@ -545,7 +545,7 @@ func mockedCreateVPCCalls(m *mocks.MockEC2APIMockRecorder) {
545
545
},
546
546
},
547
547
})).Return (& ec2.CreateTagsOutput {}, nil )
548
- m .DescribeSubnets ( gomock .Eq (& ec2.DescribeSubnetsInput {
548
+ m .DescribeSubnetsWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
549
549
Filters : []* ec2.Filter {
550
550
{
551
551
Name : aws .String ("state" ),
@@ -591,7 +591,7 @@ func mockedCreateVPCCalls(m *mocks.MockEC2APIMockRecorder) {
591
591
},
592
592
},
593
593
}, nil )
594
- m .DescribeRouteTables ( gomock .Eq (& ec2.DescribeRouteTablesInput {
594
+ m .DescribeRouteTablesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeRouteTablesInput {
595
595
Filters : []* ec2.Filter {
596
596
{
597
597
Name : aws .String ("vpc-id" ),
@@ -608,7 +608,7 @@ func mockedCreateVPCCalls(m *mocks.MockEC2APIMockRecorder) {
608
608
},
609
609
},
610
610
}, nil )
611
- m .DescribeNatGatewaysPages ( gomock .Eq (& ec2.DescribeNatGatewaysInput {
611
+ m .DescribeNatGatewaysPagesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeNatGatewaysInput {
612
612
Filter : []* ec2.Filter {
613
613
{
614
614
Name : aws .String ("vpc-id" ),
@@ -619,7 +619,7 @@ func mockedCreateVPCCalls(m *mocks.MockEC2APIMockRecorder) {
619
619
Values : aws .StringSlice ([]string {ec2 .VpcStatePending , ec2 .VpcStateAvailable }),
620
620
},
621
621
}}), gomock .Any ()).Return (nil )
622
- m .DescribeVpcs ( gomock .Eq (& ec2.DescribeVpcsInput {
622
+ m .DescribeVpcsWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeVpcsInput {
623
623
VpcIds : []* string {
624
624
aws .String ("vpc-exists" ),
625
625
},
@@ -652,11 +652,11 @@ func mockedCreateVPCCalls(m *mocks.MockEC2APIMockRecorder) {
652
652
}
653
653
654
654
func mockedCreateMaximumVPCCalls (m * mocks.MockEC2APIMockRecorder ) {
655
- m .CreateVpc ( gomock .AssignableToTypeOf (& ec2.CreateVpcInput {})).Return (nil , errors .New ("The maximum number of VPCs has been reached" ))
655
+ m .CreateVpcWithContext ( context . TODO (), gomock .AssignableToTypeOf (& ec2.CreateVpcInput {})).Return (nil , errors .New ("The maximum number of VPCs has been reached" ))
656
656
}
657
657
658
658
func mockedDeleteVPCCallsForNonExistentVPC (m * mocks.MockEC2APIMockRecorder ) {
659
- m .DescribeSubnets ( gomock .Eq (& ec2.DescribeSubnetsInput {
659
+ m .DescribeSubnetsWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
660
660
Filters : []* ec2.Filter {
661
661
{
662
662
Name : aws .String ("state" ),
@@ -669,7 +669,7 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
669
669
}})).Return (& ec2.DescribeSubnetsOutput {
670
670
Subnets : []* ec2.Subnet {},
671
671
}, nil ).AnyTimes ()
672
- m .DescribeRouteTables ( gomock .Eq (& ec2.DescribeRouteTablesInput {
672
+ m .DescribeRouteTablesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeRouteTablesInput {
673
673
Filters : []* ec2.Filter {{
674
674
Name : aws .String ("vpc-id" ),
675
675
Values : aws .StringSlice ([]string {"" }),
@@ -680,7 +680,7 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
680
680
},
681
681
}})).Return (& ec2.DescribeRouteTablesOutput {
682
682
RouteTables : []* ec2.RouteTable {}}, nil ).AnyTimes ()
683
- m .DescribeInternetGateways ( gomock .Eq (& ec2.DescribeInternetGatewaysInput {
683
+ m .DescribeInternetGatewaysWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeInternetGatewaysInput {
684
684
Filters : []* ec2.Filter {
685
685
{
686
686
Name : aws .String ("attachment.vpc-id" ),
@@ -690,27 +690,27 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
690
690
})).Return (& ec2.DescribeInternetGatewaysOutput {
691
691
InternetGateways : []* ec2.InternetGateway {},
692
692
}, nil )
693
- m .DescribeNatGatewaysPages ( gomock .Eq (& ec2.DescribeNatGatewaysInput {
693
+ m .DescribeNatGatewaysPagesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeNatGatewaysInput {
694
694
Filter : []* ec2.Filter {
695
695
{
696
696
Name : aws .String ("vpc-id" ),
697
697
Values : []* string {aws .String ("" )},
698
698
},
699
699
},
700
700
}), gomock .Any ()).Return (nil ).AnyTimes ()
701
- m .DescribeAddresses ( gomock .Eq (& ec2.DescribeAddressesInput {
701
+ m .DescribeAddressesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeAddressesInput {
702
702
Filters : []* ec2.Filter {
703
703
{
704
704
Name : aws .String ("tag-key" ),
705
705
Values : aws .StringSlice ([]string {"sigs.k8s.io/cluster-api-provider-aws/cluster/test-cluster" }),
706
706
}},
707
707
})).Return (nil , nil )
708
- m .DeleteVpc ( gomock .AssignableToTypeOf (& ec2.DeleteVpcInput {
708
+ m .DeleteVpcWithContext ( context . TODO (), gomock .AssignableToTypeOf (& ec2.DeleteVpcInput {
709
709
VpcId : aws .String ("vpc-exists" )})).Return (nil , nil )
710
710
}
711
711
712
712
func mockedDeleteVPCCalls (m * mocks.MockEC2APIMockRecorder ) {
713
- m .DescribeSubnets ( gomock .Eq (& ec2.DescribeSubnetsInput {
713
+ m .DescribeSubnetsWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
714
714
Filters : []* ec2.Filter {
715
715
{
716
716
Name : aws .String ("state" ),
@@ -731,7 +731,7 @@ func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
731
731
},
732
732
},
733
733
}, nil ).AnyTimes ()
734
- m .DescribeRouteTables ( gomock .Eq (& ec2.DescribeRouteTablesInput {
734
+ m .DescribeRouteTablesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeRouteTablesInput {
735
735
Filters : []* ec2.Filter {
736
736
{
737
737
Name : aws .String ("vpc-id" ),
@@ -753,10 +753,10 @@ func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
753
753
},
754
754
},
755
755
}, nil ).AnyTimes ()
756
- m .DeleteRouteTable ( gomock .Eq (& ec2.DeleteRouteTableInput {
756
+ m .DeleteRouteTableWithContext ( context . TODO (), gomock .Eq (& ec2.DeleteRouteTableInput {
757
757
RouteTableId : aws .String ("rt-12345" ),
758
758
}))
759
- m .DescribeInternetGateways ( gomock .Eq (& ec2.DescribeInternetGatewaysInput {
759
+ m .DescribeInternetGatewaysWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeInternetGatewaysInput {
760
760
Filters : []* ec2.Filter {
761
761
{
762
762
Name : aws .String ("attachment.vpc-id" ),
@@ -771,14 +771,14 @@ func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
771
771
},
772
772
},
773
773
}, nil )
774
- m .DetachInternetGateway ( gomock .Eq (& ec2.DetachInternetGatewayInput {
774
+ m .DetachInternetGatewayWithContext ( context . TODO (), gomock .Eq (& ec2.DetachInternetGatewayInput {
775
775
VpcId : aws .String ("vpc-exists" ),
776
776
InternetGatewayId : aws .String ("ig-12345" ),
777
777
}))
778
- m .DeleteInternetGateway ( gomock .Eq (& ec2.DeleteInternetGatewayInput {
778
+ m .DeleteInternetGatewayWithContext ( context . TODO (), gomock .Eq (& ec2.DeleteInternetGatewayInput {
779
779
InternetGatewayId : aws .String ("ig-12345" ),
780
780
}))
781
- m .DescribeNatGatewaysPages ( gomock .Eq (& ec2.DescribeNatGatewaysInput {
781
+ m .DescribeNatGatewaysPagesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeNatGatewaysInput {
782
782
Filter : []* ec2.Filter {
783
783
{
784
784
Name : aws .String ("vpc-id" ),
@@ -789,7 +789,7 @@ func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
789
789
Values : aws .StringSlice ([]string {ec2 .VpcStatePending , ec2 .VpcStateAvailable }),
790
790
},
791
791
}}), gomock .Any ()).Return (nil ).AnyTimes ()
792
- m .DescribeAddresses ( gomock .Eq (& ec2.DescribeAddressesInput {
792
+ m .DescribeAddressesWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeAddressesInput {
793
793
Filters : []* ec2.Filter {
794
794
{
795
795
Name : aws .String ("tag-key" ),
@@ -804,13 +804,13 @@ func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
804
804
},
805
805
},
806
806
}, nil )
807
- m .DisassociateAddress ( & ec2.DisassociateAddressInput {
807
+ m .DisassociateAddressWithContext ( context . TODO (), & ec2.DisassociateAddressInput {
808
808
AssociationId : aws .String ("1234" ),
809
809
})
810
- m .ReleaseAddress ( & ec2.ReleaseAddressInput {
810
+ m .ReleaseAddressWithContext ( context . TODO (), & ec2.ReleaseAddressInput {
811
811
AllocationId : aws .String ("1234" ),
812
812
})
813
- m .DescribeVpcs ( gomock .Eq (& ec2.DescribeVpcsInput {
813
+ m .DescribeVpcsWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeVpcsInput {
814
814
VpcIds : []* string {
815
815
aws .String ("vpc-exists" ),
816
816
},
@@ -844,16 +844,16 @@ func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
844
844
},
845
845
},
846
846
}, nil )
847
- m .DeleteSubnet ( gomock .Eq (& ec2.DeleteSubnetInput {
847
+ m .DeleteSubnetWithContext ( context . TODO (), gomock .Eq (& ec2.DeleteSubnetInput {
848
848
SubnetId : aws .String ("subnet-1" ),
849
849
}))
850
- m .DeleteVpc ( gomock .Eq (& ec2.DeleteVpcInput {
850
+ m .DeleteVpcWithContext ( context . TODO (), gomock .Eq (& ec2.DeleteVpcInput {
851
851
VpcId : aws .String ("vpc-exists" ),
852
852
}))
853
853
}
854
854
855
855
func mockedCreateSGCalls (recordLBV2 bool , m * mocks.MockEC2APIMockRecorder ) {
856
- m .DescribeSecurityGroups ( gomock .Eq (& ec2.DescribeSecurityGroupsInput {
856
+ m .DescribeSecurityGroupsWithContext ( context . TODO (), gomock .Eq (& ec2.DescribeSecurityGroupsInput {
857
857
Filters : []* ec2.Filter {
858
858
{
859
859
Name : aws .String ("vpc-id" ),
@@ -873,7 +873,7 @@ func mockedCreateSGCalls(recordLBV2 bool, m *mocks.MockEC2APIMockRecorder) {
873
873
},
874
874
},
875
875
}, nil )
876
- m .CreateSecurityGroup ( gomock .Eq (& ec2.CreateSecurityGroupInput {
876
+ m .CreateSecurityGroupWithContext ( context . TODO (), gomock .Eq (& ec2.CreateSecurityGroupInput {
877
877
VpcId : aws .String ("vpc-exists" ),
878
878
GroupName : aws .String ("test-cluster-bastion" ),
879
879
Description : aws .String ("Kubernetes cluster test-cluster: bastion" ),
@@ -898,7 +898,7 @@ func mockedCreateSGCalls(recordLBV2 bool, m *mocks.MockEC2APIMockRecorder) {
898
898
},
899
899
})).
900
900
Return (& ec2.CreateSecurityGroupOutput {GroupId : aws .String ("sg-bastion" )}, nil )
901
- m .CreateSecurityGroup ( gomock .Eq (& ec2.CreateSecurityGroupInput {
901
+ m .CreateSecurityGroupWithContext ( context . TODO (), gomock .Eq (& ec2.CreateSecurityGroupInput {
902
902
VpcId : aws .String ("vpc-exists" ),
903
903
GroupName : aws .String ("test-cluster-apiserver-lb" ),
904
904
Description : aws .String ("Kubernetes cluster test-cluster: apiserver-lb" ),
@@ -923,7 +923,7 @@ func mockedCreateSGCalls(recordLBV2 bool, m *mocks.MockEC2APIMockRecorder) {
923
923
},
924
924
})).
925
925
Return (& ec2.CreateSecurityGroupOutput {GroupId : aws .String ("sg-apiserver-lb" )}, nil )
926
- m .CreateSecurityGroup ( gomock .Eq (& ec2.CreateSecurityGroupInput {
926
+ m .CreateSecurityGroupWithContext ( context . TODO (), gomock .Eq (& ec2.CreateSecurityGroupInput {
927
927
VpcId : aws .String ("vpc-exists" ),
928
928
GroupName : aws .String ("test-cluster-lb" ),
929
929
Description : aws .String ("Kubernetes cluster test-cluster: lb" ),
@@ -952,7 +952,7 @@ func mockedCreateSGCalls(recordLBV2 bool, m *mocks.MockEC2APIMockRecorder) {
952
952
},
953
953
})).
954
954
Return (& ec2.CreateSecurityGroupOutput {GroupId : aws .String ("sg-lb" )}, nil )
955
- securityGroupControl := m .CreateSecurityGroup ( gomock .Eq (& ec2.CreateSecurityGroupInput {
955
+ securityGroupControl := m .CreateSecurityGroupWithContext ( context . TODO (), gomock .Eq (& ec2.CreateSecurityGroupInput {
956
956
VpcId : aws .String ("vpc-exists" ),
957
957
GroupName : aws .String ("test-cluster-controlplane" ),
958
958
Description : aws .String ("Kubernetes cluster test-cluster: controlplane" ),
@@ -977,7 +977,7 @@ func mockedCreateSGCalls(recordLBV2 bool, m *mocks.MockEC2APIMockRecorder) {
977
977
},
978
978
})).
979
979
Return (& ec2.CreateSecurityGroupOutput {GroupId : aws .String ("sg-controlplane" )}, nil )
980
- securityGroupNode := m .CreateSecurityGroup ( gomock .Eq (& ec2.CreateSecurityGroupInput {
980
+ securityGroupNode := m .CreateSecurityGroupWithContext ( context . TODO (), gomock .Eq (& ec2.CreateSecurityGroupInput {
981
981
VpcId : aws .String ("vpc-exists" ),
982
982
GroupName : aws .String ("test-cluster-node" ),
983
983
Description : aws .String ("Kubernetes cluster test-cluster: node" ),
@@ -1002,18 +1002,18 @@ func mockedCreateSGCalls(recordLBV2 bool, m *mocks.MockEC2APIMockRecorder) {
1002
1002
},
1003
1003
})).
1004
1004
Return (& ec2.CreateSecurityGroupOutput {GroupId : aws .String ("sg-node" )}, nil )
1005
- m .AuthorizeSecurityGroupIngress ( gomock .AssignableToTypeOf (& ec2.AuthorizeSecurityGroupIngressInput {
1005
+ m .AuthorizeSecurityGroupIngressWithContext ( context . TODO (), gomock .AssignableToTypeOf (& ec2.AuthorizeSecurityGroupIngressInput {
1006
1006
GroupId : aws .String ("sg-controlplane" ),
1007
1007
})).
1008
1008
Return (& ec2.AuthorizeSecurityGroupIngressOutput {}, nil ).
1009
1009
After (securityGroupControl ).Times (2 )
1010
- m .AuthorizeSecurityGroupIngress ( gomock .AssignableToTypeOf (& ec2.AuthorizeSecurityGroupIngressInput {
1010
+ m .AuthorizeSecurityGroupIngressWithContext ( context . TODO (), gomock .AssignableToTypeOf (& ec2.AuthorizeSecurityGroupIngressInput {
1011
1011
GroupId : aws .String ("sg-node" ),
1012
1012
})).
1013
1013
Return (& ec2.AuthorizeSecurityGroupIngressOutput {}, nil ).
1014
1014
After (securityGroupNode ).Times (2 )
1015
1015
if recordLBV2 {
1016
- m .AuthorizeSecurityGroupIngress ( gomock .AssignableToTypeOf (& ec2.AuthorizeSecurityGroupIngressInput {
1016
+ m .AuthorizeSecurityGroupIngressWithContext ( context . TODO (), gomock .AssignableToTypeOf (& ec2.AuthorizeSecurityGroupIngressInput {
1017
1017
GroupId : aws .String ("sg-lb" ),
1018
1018
})).
1019
1019
Return (& ec2.AuthorizeSecurityGroupIngressOutput {}, nil ).
0 commit comments