use region input to detect the Bucket region

Signed-off-by: Jalaja Ganapathy <jalaja@replicated.com>

Signed-off-by: Jalaja <jalaja@replicated.com>
pull/3617/head
Jalaja 2021-03-23 19:16:37 +00:00
parent e9c997839e
commit 40a1b62c09
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Region is calculated incorrectly when gov account is used.

View File

@ -64,10 +64,14 @@ func getRepoPrefix(location *velerov1api.BackupStorageLocation) (string, error)
switch backendType {
case AWSBackend:
var url string
var region string
switch {
// non-AWS, S3-compatible object store
case location.Spec.Config["s3Url"] != "":
url = location.Spec.Config["s3Url"]
case location.Spec.Config["region"] != "":
region = location.Spec.Config["region"]
url = fmt.Sprintf("s3-%s.amazonaws.com", region)
default:
region, err := getAWSBucketRegion(bucket)
if err != nil {