From 453b67b24d942221fc641fd6c61dfd1b25e2858a Mon Sep 17 00:00:00 2001 From: Shubham Pampattiwar Date: Tue, 6 Jun 2023 00:14:42 -0700 Subject: [PATCH] Remove VS name annotation from PVC during CSI restore Signed-off-by: Shubham Pampattiwar --- internal/restore/pvc_action.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/restore/pvc_action.go b/internal/restore/pvc_action.go index f5ca06db..d460f623 100644 --- a/internal/restore/pvc_action.go +++ b/internal/restore/pvc_action.go @@ -122,6 +122,9 @@ func (p *PVCRestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInp }, nil } + // remove the volumesnapshot name annotation as well + removePVCAnnotations(&pvc, []string{util.VolumeSnapshotLabel}) + 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 = ""