From 01f40a12cb242122e307134eb9ea95b0e7a5e7e9 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Fri, 4 Oct 2024 12:49:02 -0700 Subject: [PATCH] don't update bucket region with custom endpoints (#786) --- pkg/pipeline/sink/uploader/s3.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/pipeline/sink/uploader/s3.go b/pkg/pipeline/sink/uploader/s3.go index 3ffe946d..973ef8a4 100644 --- a/pkg/pipeline/sink/uploader/s3.go +++ b/pkg/pipeline/sink/uploader/s3.go @@ -53,7 +53,7 @@ func newS3Uploader(conf *config.EgressS3Upload) (uploader, error) { opts := func(o *awsConfig.LoadOptions) error { if conf.Region != "" { o.Region = conf.Region - } else { + } else if conf.Endpoint == "" { o.Region = defaultBucketLocation } @@ -99,14 +99,13 @@ func newS3Uploader(conf *config.EgressS3Upload) (uploader, error) { return nil, err } - if conf.Region == "" { + if conf.Endpoint != "" { + awsConf.BaseEndpoint = &conf.Endpoint + } else if conf.Region == "" { if err = updateRegion(&awsConf, conf.Bucket); err != nil { return nil, err } } - if conf.Endpoint != "" { - awsConf.BaseEndpoint = &conf.Endpoint - } return &S3Uploader{ conf: conf,