mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-21 06:36:06 +00:00
strip leading/trailing slashes from BSL bucket & prefix vals (#1694)
* strip leading/trailing slashes from BSL bucket & prefix vals Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
@@ -63,12 +63,21 @@ func (b *BackupStorageLocationBuilder) Provider(name string) *BackupStorageLocat
|
||||
return b
|
||||
}
|
||||
|
||||
// ObjectStorage sets the BackupStorageLocation's object storage.
|
||||
func (b *BackupStorageLocationBuilder) ObjectStorage(bucketName string) *BackupStorageLocationBuilder {
|
||||
// Bucket sets the BackupStorageLocation's object storage bucket.
|
||||
func (b *BackupStorageLocationBuilder) Bucket(val string) *BackupStorageLocationBuilder {
|
||||
if b.object.Spec.StorageType.ObjectStorage == nil {
|
||||
b.object.Spec.StorageType.ObjectStorage = new(velerov1api.ObjectStorageLocation)
|
||||
}
|
||||
b.object.Spec.ObjectStorage.Bucket = bucketName
|
||||
b.object.Spec.ObjectStorage.Bucket = val
|
||||
return b
|
||||
}
|
||||
|
||||
// Prefix sets the BackupStorageLocation's object storage prefix.
|
||||
func (b *BackupStorageLocationBuilder) Prefix(val string) *BackupStorageLocationBuilder {
|
||||
if b.object.Spec.StorageType.ObjectStorage == nil {
|
||||
b.object.Spec.StorageType.ObjectStorage = new(velerov1api.ObjectStorageLocation)
|
||||
}
|
||||
b.object.Spec.ObjectStorage.Prefix = val
|
||||
return b
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user