mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-13 11:34:54 +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")
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/vmware-tanzu/velero/internal/resourcepolicies"
|
||||
veleroshared "github.com/vmware-tanzu/velero/pkg/apis/velero/shared"
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
veleroclient "github.com/vmware-tanzu/velero/pkg/client"
|
||||
"github.com/vmware-tanzu/velero/pkg/label"
|
||||
@@ -598,5 +599,9 @@ func newPodVolumeBackup(backup *velerov1api.Backup, pod *corev1api.Pod, volume c
|
||||
pvb.Spec.UploaderSettings = uploaderutil.StoreBackupConfig(backup.Spec.UploaderConfig)
|
||||
}
|
||||
|
||||
if backup.Spec.BackupType == velerov1api.BackupTypeFull {
|
||||
pvb.Spec.ParentSnapshot = veleroshared.ParentSnapshotNone
|
||||
}
|
||||
|
||||
return pvb
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user