mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 03:35:22 +00:00
use backup's defaultRestic flag to identify pod volumes using restic
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
This commit is contained in:
@@ -71,6 +71,7 @@ type backupController struct {
|
||||
backupTracker BackupTracker
|
||||
backupLocationLister velerov1listers.BackupStorageLocationLister
|
||||
defaultBackupLocation string
|
||||
defaultRestic bool
|
||||
defaultBackupTTL time.Duration
|
||||
snapshotLocationLister velerov1listers.VolumeSnapshotLocationLister
|
||||
defaultSnapshotLocations map[string]string
|
||||
@@ -92,6 +93,7 @@ func NewBackupController(
|
||||
backupTracker BackupTracker,
|
||||
backupLocationLister velerov1listers.BackupStorageLocationLister,
|
||||
defaultBackupLocation string,
|
||||
defaultRestic bool,
|
||||
defaultBackupTTL time.Duration,
|
||||
volumeSnapshotLocationLister velerov1listers.VolumeSnapshotLocationLister,
|
||||
defaultSnapshotLocations map[string]string,
|
||||
@@ -120,6 +122,7 @@ func NewBackupController(
|
||||
volumeSnapshotLister: volumeSnapshotLister,
|
||||
volumeSnapshotContentLister: volumeSnapshotContentLister,
|
||||
newBackupStore: persistence.NewObjectBackupStore,
|
||||
defaultRestic: defaultRestic,
|
||||
}
|
||||
|
||||
c.syncHandler = c.processBackup
|
||||
@@ -339,6 +342,10 @@ func (c *backupController) prepareBackupRequest(backup *velerov1api.Backup) *pkg
|
||||
request.Spec.StorageLocation = c.defaultBackupLocation
|
||||
}
|
||||
|
||||
if request.Spec.DefaultRestic == nil {
|
||||
request.Spec.DefaultRestic = &c.defaultRestic
|
||||
}
|
||||
|
||||
// add the storage location as a label for easy filtering later.
|
||||
if request.Labels == nil {
|
||||
request.Labels = make(map[string]string)
|
||||
|
||||
Reference in New Issue
Block a user