Skip to content

VolumeSnapshotRef.UID should be cleared on volumesnapshot deletion #274

@ashish-amarnath

Description

@ashish-amarnath

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

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions