Skip to content

Commit 82e7e66

Browse files
committed
Fix SDK paginator mocks
The latest version of `aws-sdk-go-v2/service/eks` breaks unit tests. This [changelist](aws/aws-sdk-go-v2#2682) added SDK-specific feature tracking where all paginated operations now pass an additional argument (`addIsPaginatorUserAgent`) to add `UserAgentFeaturePaginator` to the user agent. The mocks, however, do not expect this variadic argument to be passed, resulting in failing assertions. Fixes eksctl-io#7845
1 parent 3cbd926 commit 82e7e66

21 files changed

+87
-82
lines changed

go.mod

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ require (
1111
github.com/Masterminds/semver/v3 v3.2.1
1212
github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20230601180523-74e721cb8c1e
1313
github.com/aws/aws-sdk-go v1.51.16
14-
github.com/aws/aws-sdk-go-v2 v1.27.1
14+
github.com/aws/aws-sdk-go-v2 v1.30.0
1515
github.com/aws/aws-sdk-go-v2/config v1.27.11
1616
github.com/aws/aws-sdk-go-v2/credentials v1.17.11
1717
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5
18-
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.0
18+
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.52.1
1919
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.39.2
2020
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.35.1
2121
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3
22-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.156.0
23-
github.com/aws/aws-sdk-go-v2/service/eks v1.43.0
22+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0
23+
github.com/aws/aws-sdk-go-v2/service/eks v1.44.1
2424
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.24.4
2525
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.30.5
2626
github.com/aws/aws-sdk-go-v2/service/iam v1.32.0
@@ -127,11 +127,11 @@ require (
127127
github.com/atotto/clipboard v0.1.4 // indirect
128128
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
129129
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
130-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8 // indirect
131-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8 // indirect
130+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 // indirect
131+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 // indirect
132132
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
133133
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
134-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
134+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 // indirect
135135
github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 // indirect
136136
github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect
137137
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect

go.sum

+14-14
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20230601180523-74e721cb8
716716
github.com/aws/aws-sdk-go v1.51.16 h1:vnWKK8KjbftEkuPX8bRj3WHsLy1uhotn0eXptpvrxJI=
717717
github.com/aws/aws-sdk-go v1.51.16/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
718718
github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
719-
github.com/aws/aws-sdk-go-v2 v1.27.1 h1:xypCL2owhog46iFxBKKpBcw+bPTX/RJzwNj8uSilENw=
720-
github.com/aws/aws-sdk-go-v2 v1.27.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
719+
github.com/aws/aws-sdk-go-v2 v1.30.0 h1:6qAwtzlfcTtcL8NHtbDQAqgM5s6NDipQTkPxyH/6kAA=
720+
github.com/aws/aws-sdk-go-v2 v1.30.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
721721
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
722722
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
723723
github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA=
@@ -727,27 +727,27 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6
727727
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4=
728728
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg=
729729
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22/go.mod h1:/vNv5Al0bpiF8YdX2Ov6Xy05VTiXsql94yUqJMYaj0w=
730-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8 h1:RnLB7p6aaFMRfyQkD6ckxR7myCC9SABIqSz4czYUUbU=
731-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8/go.mod h1:XH7dQJd+56wEbP1I4e4Duo+QhSMxNArE8VP7NuUOTeM=
730+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12 h1:SJ04WXGTwnHlWIODtC5kJzKbeuHt+OUNOgKg7nfnUGw=
731+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.12/go.mod h1:FkpvXhA92gb3GE9LD6Og0pHHycTxW7xGpnEh5E7Opwo=
732732
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16/go.mod h1:62dsXI0BqTIGomDl8Hpm33dv0OntGaVblri3ZRParVQ=
733-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8 h1:jzApk2f58L9yW9q1GEab3BMMFWUkkiZhyrRUtbwUbKU=
734-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8/go.mod h1:WqO+FftfO3tGePUtQxPXM6iODVfqMwsVMgTbG/ZXIdQ=
733+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12 h1:hb5KgeYfObi5MHkSSZMEudnIvX30iB+E21evI4r6BnQ=
734+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.12/go.mod h1:CroKe/eWJdyfy9Vx4rljP5wTUjNJfb+fPz1uMYUhEGM=
735735
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
736736
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
737737
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5 h1:vhdJymxlWS2qftzLiuCjSswjXBRLGfzo/BEE9LDveBA=
738738
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5/go.mod h1:ZErgk/bPaaZIpj+lUWGlwI1A0UFhSIscgnCPzTLnb2s=
739-
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.0 h1:Ap5tOJfeAH1hO2UQc3X3uMlwP7uryFeZXMvZCXIlLSE=
740-
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.0/go.mod h1:/v2KYdCW4BaHKayenaWEXOOdxItIwEA3oU0XzuQY3F0=
739+
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.52.1 h1:Ts+mCjOtt8o2k2vnWnX/0sE0eSmEVWBvfJkNrNMQlAo=
740+
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.52.1/go.mod h1:IrWhabzdTEc651GAq7rgst/SYcEqqcD7Avr82m28AAU=
741741
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.39.2 h1:svl3DNKWpcLOlz+bFzmOxGp8gcbvSZ6m2t44Zzaet9U=
742742
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.39.2/go.mod h1:gAJs+mKIoK4JTQD1KMZtHgyBRZ8S6Oy5+qjJzoDAvbE=
743743
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.35.1 h1:suWu59CRsDNhw2YXPpa6drYEetIUUIMUhkzHmucbCf8=
744744
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.35.1/go.mod h1:tZiRxrv5yBRgZ9Z4OOOxwscAZRFk5DgYhEcjX1QpvgI=
745745
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3 h1:JNWpkjImTP2e308bv7ihfwgOawf640BY/pyZWrBb9rw=
746746
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3/go.mod h1:TiLZ2/+WAEyG2PnuAYj/un46UJ7qBf5BWWTAKgaHP8I=
747-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.156.0 h1:TFK9GeUINErClL2+A+GLYhjiChVdaXCgIUiCsS/UQrE=
748-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.156.0/go.mod h1:xejKuuRDjz6z5OqyeLsz01MlOqqW7CqpAB4PabNvpu8=
749-
github.com/aws/aws-sdk-go-v2/service/eks v1.43.0 h1:TRgA51vdnrXiZpCab7pQT0bF52rX5idH0/fzrIVnQS0=
750-
github.com/aws/aws-sdk-go-v2/service/eks v1.43.0/go.mod h1:875ZmajQCZ9N7HeR1DE25nTSaalkqGYzQa+BxLattlQ=
747+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0 h1:FDZVMxzXB13cRmHs3t3tH9gme8GhvmjsQXeXFI37OHU=
748+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0/go.mod h1:Wv7N3iFOKVsZNIaw9MOBUmwCkX6VMmQQRFhMrHtNGno=
749+
github.com/aws/aws-sdk-go-v2/service/eks v1.44.1 h1:onUAzZXDsyXzyrmOGw/9p8Csl1NZkTDEs4URZ8covUY=
750+
github.com/aws/aws-sdk-go-v2/service/eks v1.44.1/go.mod h1:dg9l/W4hXygeRNydRB4LWKY/MwHJhfUomGJUBwI29Dw=
751751
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.24.4 h1:V5YvSMQwZklktzYeOOhYdptx7rP650XP3RnxwNu1UEQ=
752752
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.24.4/go.mod h1:aYygRYqRxmLGrxRxAisgNarwo4x8bcJG14rh4r57VqE=
753753
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.30.5 h1:/x2u/TOx+n17U+gz98TOw1HKJom0EOqrhL4SjrHr0cQ=
@@ -756,8 +756,8 @@ github.com/aws/aws-sdk-go-v2/service/iam v1.32.0 h1:ZNlfPdw849gBo/lvLFbEEvpTJMij
756756
github.com/aws/aws-sdk-go-v2/service/iam v1.32.0/go.mod h1:aXWImQV0uTW35LM0A/T4wEg6R1/ReXUu4SM6/lUHYK0=
757757
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=
758758
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=
759-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo=
760-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk=
759+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 h1:zSDPny/pVnkqABXYRicYuPf9z2bTqfH13HT3v6UheIk=
760+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14/go.mod h1:3TTcI5JSzda1nw/pkVC9dhgLre0SNBFj2lYS4GctXKI=
761761
github.com/aws/aws-sdk-go-v2/service/kms v1.27.5 h1:7lKTr8zJ2nVaVgyII+7hUayTi7xWedMuANiNVXiD2S8=
762762
github.com/aws/aws-sdk-go-v2/service/kms v1.27.5/go.mod h1:D9FVDkZjkZnnFHymJ3fPVz0zOUlNSd0xcIIVmmrAac8=
763763
github.com/aws/aws-sdk-go-v2/service/outposts v1.38.0 h1:e4uIyH2aMFUtUaHjO/NCNBkXdxBBJj3OnSM5pMo5i0s=

pkg/actions/cluster/get_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var _ = Describe("Get", func() {
4949
intialProvider.MockEKS().On("ListClusters", mock.Anything, &awseks.ListClustersInput{
5050
MaxResults: aws.Int32(100),
5151
Include: []string{"all"},
52-
}).Return(&awseks.ListClustersOutput{
52+
}, mock.Anything).Return(&awseks.ListClustersOutput{
5353
Clusters: []string{"cluster1", "cluster2", "cluster3"},
5454
}, nil)
5555

@@ -110,7 +110,7 @@ var _ = Describe("Get", func() {
110110
intialProvider.MockEKS().On("ListClusters", mock.Anything, &awseks.ListClustersInput{
111111
MaxResults: aws.Int32(100),
112112
Include: []string{"all"},
113-
}).Return(nil, fmt.Errorf("foo"))
113+
}, mock.Anything).Return(nil, fmt.Errorf("foo"))
114114
})
115115

116116
It("errors", func() {
@@ -158,14 +158,14 @@ var _ = Describe("Get", func() {
158158
providerRegion1.MockEKS().On("ListClusters", mock.Anything, &awseks.ListClustersInput{
159159
MaxResults: aws.Int32(100),
160160
Include: []string{"all"},
161-
}).Return(&awseks.ListClustersOutput{
161+
}, mock.Anything).Return(&awseks.ListClustersOutput{
162162
Clusters: []string{"cluster1"},
163163
}, nil)
164164

165165
providerRegion2.MockEKS().On("ListClusters", mock.Anything, &awseks.ListClustersInput{
166166
MaxResults: aws.Int32(100),
167167
Include: []string{"all"},
168-
}).Return(&awseks.ListClustersOutput{
168+
}, mock.Anything).Return(&awseks.ListClustersOutput{
169169
Clusters: []string{"cluster2"},
170170
}, nil)
171171

@@ -242,7 +242,7 @@ var _ = Describe("Get", func() {
242242
providerRegion1.MockEKS().On("ListClusters", mock.Anything, &awseks.ListClustersInput{
243243
MaxResults: aws.Int32(100),
244244
Include: []string{"all"},
245-
}).Return(&awseks.ListClustersOutput{
245+
}, mock.Anything).Return(&awseks.ListClustersOutput{
246246
Clusters: []string{"cluster1"},
247247
}, nil)
248248

pkg/actions/cluster/owned_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var _ = Describe("Delete", func() {
9797

9898
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
9999

100-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
100+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
101101

102102
fakeStackManager.NewTasksToDeleteClusterWithNodeGroupsReturns(&tasks.TaskTree{
103103
Tasks: []tasks.Task{&tasks.GenericTask{Doer: func() error {
@@ -174,7 +174,7 @@ var _ = Describe("Delete", func() {
174174

175175
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
176176

177-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
177+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
178178

179179
fakeStackManager.NewTasksToDeleteClusterWithNodeGroupsReturns(&tasks.TaskTree{
180180
Tasks: []tasks.Task{},
@@ -239,7 +239,7 @@ var _ = Describe("Delete", func() {
239239

240240
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
241241

242-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
242+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
243243

244244
fakeStackManager.NewTasksToDeleteClusterWithNodeGroupsReturns(&tasks.TaskTree{
245245
Tasks: []tasks.Task{},
@@ -306,7 +306,7 @@ var _ = Describe("Delete", func() {
306306

307307
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
308308

309-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
309+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
310310

311311
fakeStackManager.NewTasksToDeleteClusterWithNodeGroupsReturns(&tasks.TaskTree{
312312
Tasks: []tasks.Task{&tasks.GenericTask{Doer: func() error {

pkg/actions/cluster/unowned_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ var _ = Describe("Delete", func() {
116116

117117
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
118118

119-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
119+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
120120

121121
fakeStackManager.GetFargateStackReturns(&types.Stack{StackName: aws.String("fargate-role")}, nil)
122122
fakeStackManager.DeleteStackBySpecReturns(nil, nil)
@@ -205,7 +205,7 @@ var _ = Describe("Delete", func() {
205205

206206
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
207207

208-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
208+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
209209

210210
fakeStackManager.GetFargateStackReturns(nil, nil)
211211
fakeStackManager.DeleteStackBySpecReturns(nil, nil)
@@ -308,7 +308,7 @@ var _ = Describe("Delete", func() {
308308

309309
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
310310

311-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
311+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
312312

313313
fakeStackManager.GetFargateStackReturns(nil, nil)
314314
fakeStackManager.DeleteStackBySpecReturns(nil, nil)
@@ -391,7 +391,7 @@ var _ = Describe("Delete", func() {
391391

392392
p.MockEC2().On("DescribeKeyPairs", mock.Anything, mock.Anything).Return(&ec2.DescribeKeyPairsOutput{}, nil)
393393

394-
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
394+
p.MockEC2().On("DescribeSecurityGroups", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSecurityGroupsOutput{}, nil)
395395

396396
p.MockEKS().On("ListNodegroups", mock.Anything, mock.Anything).Return(&awseks.ListNodegroupsOutput{
397397
Nodegroups: []string{"ng-1", "ng-2"},

pkg/actions/nodegroup/create_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ var _ = DescribeTable("Create", func(t ngEntry) {
168168
mockCalls: func(m mockCalls) {
169169
m.kubeProvider.NewRawClientReturns(&kubernetes.RawClient{}, nil)
170170
m.kubeProvider.ServerVersionReturns("1.17", nil)
171-
m.mockProvider.MockCloudFormation().On("ListStacks", mock.Anything, mock.Anything).Return(&cloudformation.ListStacksOutput{
171+
m.mockProvider.MockCloudFormation().On("ListStacks", mock.Anything, mock.Anything, mock.Anything).Return(&cloudformation.ListStacksOutput{
172172
StackSummaries: []cftypes.StackSummary{
173173
{
174174
StackName: aws.String("eksctl-my-cluster-cluster"),
@@ -854,7 +854,7 @@ func mockProviderWithVPCSubnets(p *mockprovider.MockProvider, subnets *vpcSubnet
854854
}
855855

856856
func mockProviderWithConfig(p *mockprovider.MockProvider, describeStacksOutput []cftypes.Output, subnets *vpcSubnets, vpcConfigRes *ekstypes.VpcConfigResponse, outpostConfig *ekstypes.OutpostConfigResponse, accessConfig *ekstypes.AccessConfigResponse) {
857-
p.MockCloudFormation().On("ListStacks", mock.Anything, mock.Anything).Return(&cloudformation.ListStacksOutput{
857+
p.MockCloudFormation().On("ListStacks", mock.Anything, mock.Anything, mock.Anything).Return(&cloudformation.ListStacksOutput{
858858
StackSummaries: []cftypes.StackSummary{
859859
{
860860
StackName: aws.String("eksctl-my-cluster-cluster"),
@@ -986,7 +986,7 @@ func mockProviderWithConfig(p *mockprovider.MockProvider, describeStacksOutput [
986986
if vpcID == "" {
987987
mp.MockEC2().On("DescribeSubnets", mock.Anything, &ec2.DescribeSubnetsInput{
988988
SubnetIds: subnetIDs,
989-
}).Return(&ec2.DescribeSubnetsOutput{Subnets: subnets}, nil)
989+
}, mock.Anything).Return(&ec2.DescribeSubnetsOutput{Subnets: subnets}, nil)
990990
return
991991
}
992992
mp.MockEC2().On("DescribeSubnets", mock.Anything, &ec2.DescribeSubnetsInput{
@@ -996,7 +996,7 @@ func mockProviderWithConfig(p *mockprovider.MockProvider, describeStacksOutput [
996996
Values: []string{vpcID},
997997
},
998998
},
999-
}).Return(&ec2.DescribeSubnetsOutput{Subnets: subnets}, nil)
999+
}, mock.Anything).Return(&ec2.DescribeSubnetsOutput{Subnets: subnets}, nil)
10001000
}
10011001

10021002
mockDescribeSubnets(p, "", subnets.publicIDs)
@@ -1021,7 +1021,7 @@ func mockProviderWithConfig(p *mockprovider.MockProvider, describeStacksOutput [
10211021
func mockProviderForUnownedCluster(p *mockprovider.MockProvider, k *eksfakes.FakeKubeProvider, extraSGRules ...ec2types.SecurityGroupRule) {
10221022
k.NewRawClientReturns(&kubernetes.RawClient{}, nil)
10231023
k.ServerVersionReturns("1.27", nil)
1024-
p.MockCloudFormation().On("ListStacks", mock.Anything, mock.Anything).Return(&cloudformation.ListStacksOutput{
1024+
p.MockCloudFormation().On("ListStacks", mock.Anything, mock.Anything, mock.Anything).Return(&cloudformation.ListStacksOutput{
10251025
StackSummaries: []cftypes.StackSummary{
10261026
{
10271027
StackName: aws.String("eksctl-my-cluster-cluster"),
@@ -1052,7 +1052,7 @@ func mockProviderForUnownedCluster(p *mockprovider.MockProvider, k *eksfakes.Fak
10521052
},
10531053
},
10541054
}, nil)
1055-
p.MockEC2().On("DescribeSubnets", mock.Anything, mock.Anything).Return(&ec2.DescribeSubnetsOutput{
1055+
p.MockEC2().On("DescribeSubnets", mock.Anything, mock.Anything, mock.Anything).Return(&ec2.DescribeSubnetsOutput{
10561056
Subnets: []ec2types.Subnet{
10571057
{
10581058
SubnetId: aws.String("subnet-custom1"),
@@ -1076,7 +1076,7 @@ func mockProviderForUnownedCluster(p *mockprovider.MockProvider, k *eksfakes.Fak
10761076
}
10771077
filter := input.Filters[0]
10781078
return *filter.Name == "group-id" && len(filter.Values) == 1 && filter.Values[0] == *sgID
1079-
})).Return(&ec2.DescribeSecurityGroupRulesOutput{
1079+
}), mock.Anything).Return(&ec2.DescribeSecurityGroupRulesOutput{
10801080
SecurityGroupRules: append([]ec2types.SecurityGroupRule{
10811081
{
10821082
Description: aws.String("Allow control plane to communicate with worker nodes in group ng-1 (kubelet and workload TCP ports"),

pkg/actions/podidentityassociation/addon_migrator_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var _ = Describe("Addon Migration", func() {
4646
mockAddonCalls := func(eksAddonsAPI *mocksv2.EKS) {
4747
eksAddonsAPI.On("ListAddons", mock.Anything, &eks.ListAddonsInput{
4848
ClusterName: aws.String(clusterName),
49-
}).Return(&eks.ListAddonsOutput{
49+
}, mock.Anything).Return(&eks.ListAddonsOutput{
5050
Addons: []string{"vpc-cni"},
5151
}, nil)
5252
eksAddonsAPI.On("DescribeAddon", mock.Anything, &eks.DescribeAddonInput{

pkg/actions/podidentityassociation/migrator_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var _ = Describe("Create", func() {
9696
mockProvider = mockprovider.NewMockProvider()
9797
mockProvider.MockEKS().On("ListAddons", mock.Anything, &awseks.ListAddonsInput{
9898
ClusterName: aws.String(clusterName),
99-
}).Return(&awseks.ListAddonsOutput{}, nil)
99+
}, mock.Anything).Return(&awseks.ListAddonsOutput{}, nil)
100100
if e.mockEKS != nil {
101101
e.mockEKS(mockProvider)
102102
}

pkg/az/az_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ var _ = Describe("AZ", func() {
215215
},
216216
LocationType: ec2types.LocationTypeAvailabilityZone,
217217
MaxResults: aws.Int32(100),
218-
}).Return(&ec2.DescribeInstanceTypeOfferingsOutput{
218+
}, mock.Anything).Return(&ec2.DescribeInstanceTypeOfferingsOutput{
219219
NextToken: aws.String("token"),
220220
InstanceTypeOfferings: []ec2types.InstanceTypeOffering{
221221
{
@@ -249,7 +249,7 @@ var _ = Describe("AZ", func() {
249249
LocationType: ec2types.LocationTypeAvailabilityZone,
250250
MaxResults: aws.Int32(100),
251251
NextToken: aws.String("token"),
252-
}).Return(&ec2.DescribeInstanceTypeOfferingsOutput{
252+
}, mock.Anything).Return(&ec2.DescribeInstanceTypeOfferingsOutput{
253253
InstanceTypeOfferings: []ec2types.InstanceTypeOffering{
254254
{
255255
InstanceType: "t2.medium",

0 commit comments

Comments
 (0)