From 34a9f500cc1487cb3bf25b5ea318bc41964c20f1 Mon Sep 17 00:00:00 2001 From: lyndon-li <98304688+Lyndon-Li@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:34:13 +0800 Subject: [PATCH] let uploader to control fallback centrally (#10523) Signed-off-by: Lyndon-Li --- changelogs/unreleased/10523-Lyndon-Li | 1 + pkg/restore/actions/csi/pvc_action.go | 3 +-- pkg/restore/actions/csi/pvc_action_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/10523-Lyndon-Li diff --git a/changelogs/unreleased/10523-Lyndon-Li b/changelogs/unreleased/10523-Lyndon-Li new file mode 100644 index 000000000..9455bfc68 --- /dev/null +++ b/changelogs/unreleased/10523-Lyndon-Li @@ -0,0 +1 @@ +Don't change restoreType from plugin, let uploader to control fallback centrally \ No newline at end of file diff --git a/pkg/restore/actions/csi/pvc_action.go b/pkg/restore/actions/csi/pvc_action.go index f71d0965a..9a1b21955 100644 --- a/pkg/restore/actions/csi/pvc_action.go +++ b/pkg/restore/actions/csi/pvc_action.go @@ -247,8 +247,7 @@ func (p *pvcRestoreItemAction) executeWithDataMove(logger *logrus.Entry, input * logger.Info("ExistingVolumeDataPolicy is in-place incremental restore and data mover is velero-block. Taking a CSI snapshot of the existing PVC as the baseline of CBT...") volumeSnapshot, err = p.createVolumeSnapshot(ctx, logger, input.Restore, *existingPVC, dataUploadResult.SnapshotClass, backup.Spec.CSISnapshotTimeout.Duration) if err != nil { - logger.Warnf("fail to create VolumeSnapshot for existing PVC %s/%s: %s, fallback to in-place full restore", existingPVC.Namespace, existingPVC.Name, err.Error()) - restoreType = velerov1api.VolumeDataPolicyTypeFull + logger.Warnf("Fail to create VolumeSnapshot for existing PVC %s/%s: %s, incremental restore will be suppressed", existingPVC.Namespace, existingPVC.Name, err.Error()) } else { defer func() { if err != nil { diff --git a/pkg/restore/actions/csi/pvc_action_test.go b/pkg/restore/actions/csi/pvc_action_test.go index b8e4912f6..1e8850e97 100644 --- a/pkg/restore/actions/csi/pvc_action_test.go +++ b/pkg/restore/actions/csi/pvc_action_test.go @@ -528,7 +528,7 @@ func TestExecute(t *testing.T) { ObjectMeta(builder.WithOwnerReference([]metav1.OwnerReference{{APIVersion: velerov1api.SchemeGroupVersion.String(), Kind: "Restore", Name: "testRestore", UID: "uid", Controller: boolptr.True()}}), builder.WithLabelsMap(map[string]string{velerov1api.AsyncOperationIDLabel: "dd-uid.", velerov1api.RestoreNameLabel: "testRestore", velerov1api.RestoreUIDLabel: "uid"}), builder.WithGenerateName("testRestore-")).Result() - d.Spec.RestoreType = "full" + d.Spec.RestoreType = "incremental" d.Spec.DataMover = "velero-block" return d }(),