From f5649bcc1fad5c2b58d6b25b175abdc560111728 Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Thu, 9 Jun 2022 16:26:05 +0800 Subject: [PATCH] Undo setting the VSC's deletion policy during backup It's not necessary to set the deletion policy as the delete item action plugin in CSI plugin will set it to Delete when the backup is deleted. Signed-off-by: Daniel Jiang --- pkg/controller/backup_controller.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/controller/backup_controller.go b/pkg/controller/backup_controller.go index 4aea25156..cea4d80c6 100644 --- a/pkg/controller/backup_controller.go +++ b/pkg/controller/backup_controller.go @@ -1045,8 +1045,6 @@ func (c *backupController) recreateVolumeSnapshotContent(vsc *snapshotv1api.Volu Namespace: "ns-" + string(vsc.UID), Name: "name-" + string(vsc.UID), } - // Revert DeletionPolicy to Delete - vsc.Spec.DeletionPolicy = snapshotv1api.VolumeSnapshotContentDelete // ResourceVersion shouldn't exist for new creation. vsc.ResourceVersion = "" _, err = c.volumeSnapshotClient.SnapshotV1().VolumeSnapshotContents().Create(context.TODO(), vsc, metav1.CreateOptions{})