udmrepo use region specified in BSL when s3URL is empty

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
Lyndon-Li
2023-10-20 19:58:54 +08:00
parent fd8350f919
commit 3d841dd8f1
2 changed files with 6 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
Fix #6988, always get region from BSL if it is not empty
+5 -3
View File
@@ -477,9 +477,11 @@ func getStorageVariables(backupLocation *velerov1api.BackupStorageLocation, repo
var err error
if s3URL == "" {
region, err = getS3BucketRegion(bucket)
if err != nil {
return map[string]string{}, errors.Wrap(err, "error get s3 bucket region")
if region == "" {
region, err = getS3BucketRegion(bucket)
if err != nil {
return map[string]string{}, errors.Wrap(err, "error get s3 bucket region")
}
}
s3URL = fmt.Sprintf("s3-%s.amazonaws.com", region)