Skip to content

Commit

Permalink
Merge pull request #6990 from Lyndon-Li/udmrepo-use-region-from-bsl
Browse files Browse the repository at this point in the history
Issue 6988: udmrepo use region specified in BSL when s3URL is empty
  • Loading branch information
reasonerjt authored Oct 20, 2023
2 parents fd8350f + 3d841dd commit 5fe53da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/6990-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 @@ -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)
Expand Down

0 comments on commit 5fe53da

Please sign in to comment.