Skip to content

Commit

Permalink
don't update bucket region with custom endpoints (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Oct 4, 2024
1 parent 9a4c230 commit 01f40a1
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 01f40a1

Please sign in to comment.