add velero server flag to allow default restic use on all pod volumes

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
This commit is contained in:
Ashish Amarnath
2020-06-15 14:46:06 -07:00
parent dd11b175ec
commit b71173228a
3 changed files with 16 additions and 0 deletions
+8
View File
@@ -71,6 +71,7 @@ type kubernetesBackupper struct {
podCommandExecutor podexec.PodCommandExecutor
resticBackupperFactory restic.BackupperFactory
resticTimeout time.Duration
defaultRestic bool
}
type resolvedAction struct {
@@ -103,6 +104,7 @@ func NewKubernetesBackupper(
podCommandExecutor podexec.PodCommandExecutor,
resticBackupperFactory restic.BackupperFactory,
resticTimeout time.Duration,
defaultRestic bool,
) (Backupper, error) {
return &kubernetesBackupper{
backupClient: backupClient,
@@ -111,6 +113,7 @@ func NewKubernetesBackupper(
podCommandExecutor: podCommandExecutor,
resticBackupperFactory: resticBackupperFactory,
resticTimeout: resticTimeout,
defaultRestic: defaultRestic,
}, nil
}
@@ -240,6 +243,11 @@ func (kb *kubernetesBackupper) Backup(log logrus.FieldLogger, backupRequest *Req
log.Infof("Including resources: %s", backupRequest.ResourceIncludesExcludes.IncludesString())
log.Infof("Excluding resources: %s", backupRequest.ResourceIncludesExcludes.ExcludesString())
if backupRequest.Backup.Spec.DefaultRestic == nil {
backupRequest.Backup.Spec.DefaultRestic = &kb.defaultRestic
}
log.Infof("Backing up all pod volumes using restic: %t", *backupRequest.Backup.Spec.DefaultRestic)
var err error
backupRequest.ResourceHooks, err = getResourceHooks(backupRequest.Spec.Hooks.Resources, kb.discoveryHelper)
if err != nil {