Skip to content

Commit

Permalink
don't update bucket region with custom endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Oct 4, 2024
1 parent 9a4c230 commit a17c61e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/pipeline/sink/uploader/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a17c61e

Please sign in to comment.