@@ -10,6 +10,8 @@ import (
1010 survey "github.com/AlecAivazis/survey/v2"
1111 "github.com/aws/aws-sdk-go-v2/aws"
1212 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
13+ "github.com/aws/aws-sdk-go-v2/aws/ratelimit"
14+ "github.com/aws/aws-sdk-go-v2/aws/retry"
1315 "github.com/aws/aws-sdk-go-v2/config"
1416 "github.com/aws/aws-sdk-go-v2/credentials"
1517 "github.com/aws/smithy-go/middleware"
@@ -41,7 +43,17 @@ type ConfigOptions []func(*config.LoadOptions) error
4143// getDefaultConfigOptions returns the default settings for config.LoadOptions.
4244func getDefaultConfigOptions () ConfigOptions {
4345 return ConfigOptions {
44- config .WithRetryMaxAttempts (RetryMaxAttempts ),
46+ config .WithRetryer (func () aws.Retryer {
47+ return retry .NewStandard (func (so * retry.StandardOptions ) {
48+ so .MaxAttempts = RetryMaxAttempts
49+
50+ // The SDK v2 introduces a new client-side rate-limiting mechanism in the standard retry.
51+ // The default settings are not a good fit for the installer, especially the destroy code.
52+ // Until we figure out a good settings, we disable it to align with SDK v1 behavior.
53+ // Reference: https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-retries-timeouts.html
54+ so .RateLimiter = ratelimit .None
55+ })
56+ }),
4557 config .WithAPIOptions ([]func (* middleware.Stack ) error {
4658 awsmiddleware .AddUserAgentKeyValue (OpenShiftInstallerUserAgent , version .Raw ),
4759 }),
0 commit comments