Skip to content

Commit

Permalink
Merge pull request #6991 from Lyndon-Li/release-1.12
Browse files Browse the repository at this point in the history
[1.12] Issue 6988: udmrepo use region specified in BSL when s3URL is empty
  • Loading branch information
blackpiglet authored Oct 20, 2023
2 parents 905cd43 + 10744ec commit bbc9790
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/6991-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix #6988, always get region from BSL if it is not empty
8 changes: 5 additions & 3 deletions pkg/repository/provider/unified_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,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)
Expand Down

0 comments on commit bbc9790

Please sign in to comment.