From d680c7a4e4d4266a0a5be19a1fca9c74ac3e0eaa Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 11 Apr 2023 21:33:22 +0800 Subject: [PATCH] Clean PVC's DataSource and DataSourceRef by setting them to nil. Signed-off-by: Xun Jiang --- internal/restore/pvc_action.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/restore/pvc_action.go b/internal/restore/pvc_action.go index 9d08219d..f5ca06db 100644 --- a/internal/restore/pvc_action.go +++ b/internal/restore/pvc_action.go @@ -125,8 +125,8 @@ func (p *PVCRestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInp if boolptr.IsSetToFalse(input.Restore.Spec.RestorePVs) { p.Log.Infof("Restore did not request for PVs to be restored from snapshot %s/%s.", input.Restore.Namespace, input.Restore.Name) pvc.Spec.VolumeName = "" - pvc.Spec.DataSource = &corev1api.TypedLocalObjectReference{} - pvc.Spec.DataSourceRef = &corev1api.TypedLocalObjectReference{} + pvc.Spec.DataSource = nil + pvc.Spec.DataSourceRef = nil } else { _, snapClient, err := util.GetClients() if err != nil {