From 7d9b4897b1e1092b35331b8809e29aead88786bb Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Wed, 5 Feb 2025 10:03:28 -0500 Subject: [PATCH] Pass all backupRepoConfig keys to storageVariables, and thus RepoOptions. Signed-off-by: Tiger Kaovilai --- pkg/repository/provider/unified_repo.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/repository/provider/unified_repo.go b/pkg/repository/provider/unified_repo.go index 6191c44528..bddeb50561 100644 --- a/pkg/repository/provider/unified_repo.go +++ b/pkg/repository/provider/unified_repo.go @@ -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) } }