Merge pull request #4976 from reasonerjt/vsc-policy-reset-undo

Undo setting the VSC's deletion policy during backup
This commit is contained in:
Wenkai Yin(尹文开)
2022-06-10 09:12:46 +08:00
committed by GitHub

View File

@@ -1013,8 +1013,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{})