Closed Akrog closed 5 years ago
My vote is for consistency between plugins in this behavior. Lets have both 1 & 2 by specifying a boolean parameter in DeleteVolumeRequest
called purgeSnapshots
.
If purgeSnapshots
is False, then the delete operation should fail if there are snapshots currently associated with the volume. If purgeSnapshots
is True, then volume deletion and snapshot deletion should occur.
As part of DeleteVolumeResponse
if purgeSnapshots
is True we should have a parameter that allows for returning the snapshotIDs of all snapshots purged by the deletion of the volume for CO book-keeping.
I like that idea, although I'm not sure if it'd fit all cases, as there was much discussion around remotely storing the data during the review of the snapshot feature.
What is the expected behavior of v1.0? Because if csi-sanity's behavior is a good reference, and I hope it is because I've used it for my CSI plugin, then it's applying option #3.
I don't see the spec defining the behavior of a DeleteVolume call when the volume being deleted has snapshots.
In most backends deleting a volume with snapshots is not directly possible, one must delete the snapshots first. There are also backends that cascade delete the snapshots (after confirmation) when deleting such volume.
I see 3 possible behaviors, and we should be explicit about which one we expect in the spec:
From a storage driver perspective the first option is the most reasonable, and from a CO's perspective the third option is the most convenient, as it decouples volumes and snapshots, which makes sense for cases where snapshots are really off-premise backups that are uploaded as a post-processing operation and the cut snapshot is deleted after the post-processing.