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:
lyndon-li
2026-08-18 13:08:41 +08:00
committed by GitHub
parent 6256b4fcb4
commit fa95eb0aa7
12 changed files with 55 additions and 27 deletions
+11 -2
View File
@@ -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")
+5
View File
@@ -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
}