From 008a4210e57f7dad4d7c85ca33a3895c371f2472 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Thu, 5 Sep 2024 16:03:13 -0400 Subject: [PATCH] [sc-107258] fix: resolve the s3 endpoint correctly when setting the s3 region. This PR fixes the following error: ``` [2024/09/05 15:59:06] [error] Failed to process file: log-test4.log from S3 bucket 'caly-tester': operation error S3: GetObject, resolve auth scheme: resolve endpoint: endpoint rule error, Custom endpoint `` was not a valid URI ``` Signed-off-by: Phillip Whelan --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 9f418d3..7347308 100644 --- a/client.go +++ b/client.go @@ -48,9 +48,10 @@ func (r *resolverV2) ResolveEndpoint(ctx context.Context, params s3.EndpointPara smithyendpoints.Endpoint, error, ) { - params.Endpoint = aws.String(r.BaseEndpoint) if r.Region != "" { params.Region = aws.String(r.Region) + } else { + params.Endpoint = aws.String(r.BaseEndpoint) } return s3.NewDefaultEndpointResolverV2().ResolveEndpoint(ctx, params) }