-
Notifications
You must be signed in to change notification settings - Fork 405
Description
User story
As a user of CSI volumesnapshot APIs, I would like to be able to reuse existing volumesnapshotcontents to provision new volumes pre-populated data when using DeletionPolicy: Retain on the volumesnapshotcontent.
Detailed Description
When using DeletionPolicy: Retain on the volumesnapshotcontent, deletion of volumesnapshot objects will leave a dangling reference to the deleted volumesnapshot object, preventing new volumesnapshots, with the same name in the same namespace, to attach back to the volumesnapshotcontent.
Proposal
When a volumesnapshot is deleted, and the DeletionPolicy on the underlying volumesnapshotcontent is Retain, the deletion should cascade back to the volumesnapshotcontent to clear the volumesnapshotcontent's Spec.VolumeSnapshotRef.UID to allow it to be reused by a new volumesnapshot object with the same name and in the same namespace.
It should also be considered to update the Source of the volumesnapshot content by:
1. Clearing volumesnapshotcontent.Spec.Source.volumehandle to empty (nil or "")
1. Setting volumesnapshotcontent.Spec.Source.snapshothandle to the volumesnapshotcontent.Status.snapshotHandle
cc @xing-yang