From 80d2f38192cab365068d3f1d1a65ed7d4822cb92 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 5 Jul 2020 09:49:26 +0100 Subject: [PATCH] s3: fix bucket Region auto detection when Region unset in config #2915 Previous to this fix if Region was not set and Endpoint was not set then we set the endpoint to "https://s3.amazonaws.com/". This is unecessary because if the Region alone isn't set then we set it to "us-east-1" which has the same endpoint. Having the endpoint set breaks the bucket region auto detection with the error "Failed to update region for bucket: can't set region to "xxx" as endpoint is set". This fix removes that check. --- backend/s3/s3.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 0b66088dc..364de40d1 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -1188,9 +1188,6 @@ func s3Connection(opt *Options) (*s3.S3, *session.Session, error) { return nil, nil, errors.New("secret_access_key not found") } - if opt.Region == "" && opt.Endpoint == "" { - opt.Endpoint = "https://s3.amazonaws.com/" - } if opt.Region == "" { opt.Region = "us-east-1" }