chore: upgrade dependencies
This commit is contained in:
92
vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go
generated
vendored
92
vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go
generated
vendored
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
|
||||
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
)
|
||||
|
||||
@@ -20,9 +21,15 @@ import (
|
||||
// This should be used as the first resolver in the slice of resolvers when
|
||||
// resolving external configuration.
|
||||
func resolveDefaultAWSConfig(ctx context.Context, cfg *aws.Config, cfgs configs) error {
|
||||
var sources []interface{}
|
||||
for _, s := range cfgs {
|
||||
sources = append(sources, s)
|
||||
}
|
||||
|
||||
*cfg = aws.Config{
|
||||
Credentials: aws.AnonymousCredentials{},
|
||||
Logger: logging.NewStandardLogger(os.Stderr),
|
||||
Credentials: aws.AnonymousCredentials{},
|
||||
Logger: logging.NewStandardLogger(os.Stderr),
|
||||
ConfigSources: sources,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -166,6 +173,22 @@ func resolveEndpointResolver(ctx context.Context, cfg *aws.Config, configs confi
|
||||
return nil
|
||||
}
|
||||
|
||||
// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice
|
||||
// and sets the functions result on the aws.Config.EndpointResolver
|
||||
func resolveEndpointResolverWithOptions(ctx context.Context, cfg *aws.Config, configs configs) error {
|
||||
endpointResolver, found, err := getEndpointResolverWithOptions(ctx, configs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !found {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.EndpointResolverWithOptions = endpointResolver
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveLogger(ctx context.Context, cfg *aws.Config, configs configs) error {
|
||||
logger, found, err := getLogger(ctx, configs)
|
||||
if err != nil {
|
||||
@@ -199,13 +222,17 @@ func resolveRetryer(ctx context.Context, cfg *aws.Config, configs configs) error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !found {
|
||||
|
||||
if found {
|
||||
cfg.Retryer = retryer
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.Retryer = retryer
|
||||
|
||||
return nil
|
||||
// Only load the retry options if a custom retryer has not be specified.
|
||||
if err = resolveRetryMaxAttempts(ctx, cfg, configs); err != nil {
|
||||
return err
|
||||
}
|
||||
return resolveRetryMode(ctx, cfg, configs)
|
||||
}
|
||||
|
||||
func resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs) error {
|
||||
@@ -225,3 +252,56 @@ func resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveDefaultsModeOptions(ctx context.Context, cfg *aws.Config, configs configs) error {
|
||||
defaultsMode, found, err := getDefaultsMode(ctx, configs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !found {
|
||||
defaultsMode = aws.DefaultsModeLegacy
|
||||
}
|
||||
|
||||
var environment aws.RuntimeEnvironment
|
||||
if defaultsMode == aws.DefaultsModeAuto {
|
||||
envConfig, _, _ := getAWSConfigSources(configs)
|
||||
|
||||
client, found, err := getDefaultsModeIMDSClient(ctx, configs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !found {
|
||||
client = imds.NewFromConfig(*cfg)
|
||||
}
|
||||
|
||||
environment, err = resolveDefaultsModeRuntimeEnvironment(ctx, envConfig, client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
cfg.DefaultsMode = defaultsMode
|
||||
cfg.RuntimeEnvironment = environment
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveRetryMaxAttempts(ctx context.Context, cfg *aws.Config, configs configs) error {
|
||||
maxAttempts, found, err := getRetryMaxAttempts(ctx, configs)
|
||||
if err != nil || !found {
|
||||
return err
|
||||
}
|
||||
cfg.RetryMaxAttempts = maxAttempts
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveRetryMode(ctx context.Context, cfg *aws.Config, configs configs) error {
|
||||
retryMode, found, err := getRetryMode(ctx, configs)
|
||||
if err != nil || !found {
|
||||
return err
|
||||
}
|
||||
cfg.RetryMode = retryMode
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user