Skip to content

Commit 149558a

Browse files
authored
Merge pull request #16891 from hakman/automated-cherry-pick-of-#16887-upstream-release-1.30
Automated cherry pick of #16887: Fix awsup default and DescribeTag max retries
2 parents 4d4f386 + 0b4af65 commit 149558a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

upup/pkg/fi/cloudup/awsup/aws_cloud.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import (
6363
"k8s.io/kops/util/pkg/awsinterfaces"
6464
)
6565

66-
// By default, aws-sdk-go only retries 3 times, which doesn't give
66+
// By default, aws-sdk-go-v2 only retries 3 times, which doesn't give
6767
// much time for exponential backoff to work for serious issues. At 13
6868
// retries, we'll try a given request for up to ~6m with exponential
6969
// backoff along the way.
@@ -268,7 +268,11 @@ func loadAWSConfig(ctx context.Context, region string) (aws.Config, error) {
268268
awsconfig.WithClientLogMode(aws.LogRetries),
269269
awsconfig.WithLogger(awsLogger{}),
270270
awsconfig.WithRetryer(func() aws.Retryer {
271-
return retry.NewAdaptiveMode()
271+
return retry.NewAdaptiveMode(func(ao *retry.AdaptiveModeOptions) {
272+
ao.StandardOptions = append(ao.StandardOptions, func(so *retry.StandardOptions) {
273+
so.MaxAttempts = ClientMaxRetries
274+
})
275+
})
272276
}),
273277
}
274278

@@ -1260,7 +1264,9 @@ func getTags(c AWSCloud, resourceID string) (map[string]string, error) {
12601264
for {
12611265
attempt++
12621266

1263-
response, err := c.EC2().DescribeTags(ctx, request)
1267+
response, err := c.EC2().DescribeTags(ctx, request, func(o *ec2.Options) {
1268+
o.RetryMaxAttempts = DescribeTagsMaxAttempts
1269+
})
12641270
if err != nil {
12651271
if isTagsEventualConsistencyError(err) {
12661272
if attempt > DescribeTagsMaxAttempts {

0 commit comments

Comments
 (0)