kubernetes-csi / external-snapshotter

Sidecar container that watches Kubernetes Snapshot CRD objects and triggers CreateSnapshot/DeleteSnapshot against a CSI endpoint.
Apache License 2.0
502 stars 375 forks source link

Remove PVCVolumeSnapshotRefList from VolumeGroupSnapshot API #1202

Closed xing-yang closed 6 days ago

xing-yang commented 6 days ago

What happened: PVCVolumeSnapshotRefList was originally added to the Status of VolumeGroupSnapshot API so that a user knows which individual VolumeSnapshot is corresponding to which PVC when doing a restore: https://github.com/kubernetes-csi/external-snapshotter/issues/969

For dynamic provisioning of VolumeGroupSnapshot, we changed volumeSnapshotContentName to persistentVolumeClaimName in the Source field of individual VolumeSnapshot objects, and changed snapshotHandle to volumeHandle in the Source field of individual VolumeSnapshotContent objects. So we no longer need PVCVolumeSnapshotRefList in the Status of VolumeGroupSnapshot for the purpose of finding the matching PVC to do restore from a VolumeSnapshot.

For static provisioning, the VolumeSnapshot Source only contains volumeSnapshotContentName and the VolumeSnapshotContent Source only contains snapshotHandle. This means the original individual volume snapshot API objects don't contain any information about the PVC name or volume handle. It is assumed that the admin should have this information. Therefore the VolumeGroupSnapshot API does not need to provide extra information about the source PVCs.

Therefore it is now safe to remove PVCVolumeSnapshotRefList from VolumeGroupSnapshot API.

What you expected to happen:

How to reproduce it:

Anything else we need to know?:

Environment: