Skip to content

Commit

Permalink
Pass all backupRepoConfig keys to storageVariables, and thus RepoOpti…
Browse files Browse the repository at this point in the history
…ons.

Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Feb 5, 2025
1 parent 0768c35 commit 7d9b489
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/repository/provider/unified_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,13 @@ func getStorageVariables(backupLocation *velerov1api.BackupStorageLocation, repo
result[udmrepo.StoreOptionOssRegion] = strings.Trim(region, "/")
result[udmrepo.StoreOptionFsPath] = config["fspath"]

if backupRepoConfig != nil {
if v, found := backupRepoConfig[udmrepo.StoreOptionCacheLimit]; found {
result[udmrepo.StoreOptionCacheLimit] = v
// Write all backupRepoConfig to results if not exists, otherwise error on conflict
for k, v := range backupRepoConfig { // if nil, this would be skipped
if _, ok := result[k]; !ok {
// TODO: validation of allowed values for each key?
result[k] = v
} else {
return result, errors.Errorf("backupRepoConfig contains key %s that would override storage variables", k)
}
}

Expand Down

0 comments on commit 7d9b489

Please sign in to comment.