diff --git a/changelogs/unreleased/3617-jala-dx b/changelogs/unreleased/3617-jala-dx new file mode 100644 index 000000000..425fcd08c --- /dev/null +++ b/changelogs/unreleased/3617-jala-dx @@ -0,0 +1 @@ +Region is calculated incorrectly when gov account is used. diff --git a/pkg/restic/config.go b/pkg/restic/config.go index 452adbc0c..be207506e 100644 --- a/pkg/restic/config.go +++ b/pkg/restic/config.go @@ -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 {