mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-26 01:44:19 +00:00
Full backup for all data movers (#10185)
* support full backup for fs data mover Signed-off-by: Lyndon-Li <lyonghui@vmware.com> * full backup for PVB Signed-off-by: Lyndon-Li <lyonghui@vmware.com> * full backup for all data movers Signed-off-by: Lyndon-Li <lyonghui@vmware.com> * fix UT error Signed-off-by: Lyndon-Li <lyonghui@vmware.com> --------- Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/cache"
|
||||
|
||||
"github.com/vmware-tanzu/velero/internal/credentials"
|
||||
veleroshared "github.com/vmware-tanzu/velero/pkg/apis/velero/shared"
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
"github.com/vmware-tanzu/velero/pkg/datapath"
|
||||
"github.com/vmware-tanzu/velero/pkg/repository"
|
||||
@@ -192,10 +193,18 @@ func (r *BackupMicroService) RunCancelableDataPath(ctx context.Context) (string,
|
||||
|
||||
tags := map[string]string{}
|
||||
|
||||
// Modify the ParentSnapshot to "" and ForceFull to true when ParentSnapshot is "none".
|
||||
parentSnapshot := pvb.Spec.ParentSnapshot
|
||||
forceFull := false
|
||||
if pvb.Spec.ParentSnapshot == veleroshared.ParentSnapshotNone {
|
||||
parentSnapshot = ""
|
||||
forceFull = true
|
||||
}
|
||||
|
||||
if err := fsBackup.StartBackup(r.sourceTargetPath, pvb.Spec.UploaderSettings, &datapath.BackupStartParam{
|
||||
RealSource: GetRealSource(pvb),
|
||||
ParentSnapshot: "",
|
||||
ForceFull: false,
|
||||
ParentSnapshot: parentSnapshot,
|
||||
ForceFull: forceFull,
|
||||
Tags: tags,
|
||||
}); err != nil {
|
||||
return "", errors.Wrap(err, "error starting data path backup")
|
||||
|
||||
Reference in New Issue
Block a user