[#192] s3: Fix deprecated endpoint resolver
All checks were successful
All checks were successful
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
ddd86d1f23
commit
ebbc5bc0a7
1 changed files with 1 additions and 10 deletions
|
@ -53,17 +53,8 @@ func (s *S3) Exports() modules.Exports {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *S3) Connect(endpoint string, params map[string]string) (*Client, error) {
|
func (s *S3) Connect(endpoint string, params map[string]string) (*Client, error) {
|
||||||
// TODO: #192 Do not use deprecated `aws.EndpointResolver`
|
|
||||||
// nolint:staticcheck
|
|
||||||
resolver := aws.EndpointResolverWithOptionsFunc(func(_, _ string, _ ...interface{}) (aws.Endpoint, error) {
|
|
||||||
return aws.Endpoint{
|
|
||||||
URL: endpoint,
|
|
||||||
}, nil
|
|
||||||
})
|
|
||||||
|
|
||||||
// nolint:staticcheck
|
|
||||||
cfg, err := config.LoadDefaultConfig(s.vu.Context(),
|
cfg, err := config.LoadDefaultConfig(s.vu.Context(),
|
||||||
config.WithEndpointResolverWithOptions(resolver),
|
config.WithBaseEndpoint(endpoint),
|
||||||
config.WithSharedConfigProfile(params["aws_profile"]))
|
config.WithSharedConfigProfile(params["aws_profile"]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("configuration error: %w", err)
|
return nil, fmt.Errorf("configuration error: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue