mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 21:14:56 +00:00
allow custom restic repo prefix to be specified in BSL config
Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
@@ -57,6 +57,10 @@ func getRepoPrefix(location *velerov1api.BackupStorageLocation) (string, error)
|
||||
provider = "velero.io/" + provider
|
||||
}
|
||||
|
||||
if repoPrefix := location.Spec.Config["resticRepoPrefix"]; repoPrefix != "" {
|
||||
return repoPrefix, nil
|
||||
}
|
||||
|
||||
switch BackendType(provider) {
|
||||
case AWSBackend:
|
||||
var url string
|
||||
|
||||
@@ -158,7 +158,7 @@ func TestGetRepoIdentifier(t *testing.T) {
|
||||
},
|
||||
}
|
||||
id, err = GetRepoIdentifier(backupLocation, "repo-1")
|
||||
assert.EqualError(t, err, "cannot determine restic repository prefix for backup storage location")
|
||||
assert.EqualError(t, err, "restic repository prefix (resticRepoPrefix) not specified in backup storage location's config")
|
||||
assert.Empty(t, id)
|
||||
|
||||
backupLocation = &velerov1api.BackupStorageLocation{
|
||||
|
||||
Reference in New Issue
Block a user