awslogs: Replace depreacted WithEndpointResolver usage

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 2aa13e950d)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
This commit is contained in:
Paweł Gronowski 2024-02-14 18:34:12 +01:00 committed by Austin Vazquez
parent 60605eb1da
commit 584a30c772
No known key found for this signature in database
GPG key ID: F769BEB52D074D32

View file

@ -406,12 +406,11 @@ func newAWSLogsClient(info logger.Info, configOpts ...func(*config.LoadOptions)
clientOpts = append(
clientOpts,
cloudwatchlogs.WithAPIOptions(middleware.AddUserAgentKeyValue("Docker", dockerversion.Version)),
func(o *cloudwatchlogs.Options) {
o.BaseEndpoint = endpoint
},
)
if endpoint != nil {
clientOpts = append(clientOpts, cloudwatchlogs.WithEndpointResolver(cloudwatchlogs.EndpointResolverFromURL(*endpoint)))
}
client := cloudwatchlogs.NewFromConfig(cfg, clientOpts...)
return client, nil