Pass all backupRepoConfig keys to storageVariables, and thus RepoOptions.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
pull/8581/head
Tiger Kaovilai 2025-02-05 10:03:28 -05:00
parent 5a79e70d79
commit c153651044
No known key found for this signature in database
GPG Key ID: F05DADBB55627443
1 changed files with 7 additions and 3 deletions

View File

@ -576,9 +576,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)
}
}