mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 15:04:17 +00:00
support restoring/deleting legacy backups with .status.volumeBackups
Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
@@ -105,6 +105,21 @@ func (b *TestBackup) WithSnapshot(pv string, snapshot string) *TestBackup {
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *TestBackup) WithVolumeBackupInfo(pv, snapshotID, volumeType, az string, iops *int64) *TestBackup {
|
||||
if b.Status.VolumeBackups == nil {
|
||||
b.Status.VolumeBackups = make(map[string]*v1.VolumeBackupInfo)
|
||||
}
|
||||
|
||||
b.Status.VolumeBackups[pv] = &v1.VolumeBackupInfo{
|
||||
SnapshotID: snapshotID,
|
||||
Type: volumeType,
|
||||
AvailabilityZone: az,
|
||||
Iops: iops,
|
||||
}
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *TestBackup) WithSnapshotVolumes(value bool) *TestBackup {
|
||||
b.Spec.SnapshotVolumes = &value
|
||||
return b
|
||||
@@ -141,7 +156,7 @@ func (b *TestBackup) WithStorageLocation(location string) *TestBackup {
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *TestBackup) WithVolumeSnapshotLocations(locations []string) *TestBackup {
|
||||
func (b *TestBackup) WithVolumeSnapshotLocations(locations ...string) *TestBackup {
|
||||
b.Spec.VolumeSnapshotLocations = locations
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -45,6 +45,11 @@ func (location *TestVolumeSnapshotLocation) WithName(name string) *TestVolumeSna
|
||||
return location
|
||||
}
|
||||
|
||||
func (location *TestVolumeSnapshotLocation) WithProvider(name string) *TestVolumeSnapshotLocation {
|
||||
location.Spec.Provider = name
|
||||
return location
|
||||
}
|
||||
|
||||
func (location *TestVolumeSnapshotLocation) WithProviderConfig(info []LocationInfo) []*TestVolumeSnapshotLocation {
|
||||
var locations []*TestVolumeSnapshotLocation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user