kubernetes-csi / external-snapshotter

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

VolumesnapshotContent RestoreSize is set to `0` for the snapshots created for volumesnapshotgroup #1002

Closed Madhu-1 closed 8 months ago

Madhu-1 commented 9 months ago

What happened:

The RestoreSize of each volumesnapshotcontent is set to 0 even though CSI responds back the size the VolumeGroupSnapshostCreate Response, This might be because the snapshotter create the VSC with empty status and its also reconciling the VSC and Doing GetVolumeSnapshot and updating the size https://github.com/kubernetes-csi/external-snapshotter/blob/533a2ee13a39cc4e568fb9181bdac4c2a7d03bd6/pkg/sidecar-controller/snapshot_controller.go#L282-L296 Not all CSI drivers implement ListSnapshots as it's not a mandatory RPC call.

What you expected to happen:

How to reproduce it: The RestoreSize of each volumesnapshotcontent is set to the actual size returned in VolumeGroupSnapshostCreate Response

Anything else we need to know?:

Environment:

Madhu-1 commented 9 months ago

@xing-yang is this something that we can fix? i tried to fix it https://github.com/Madhu-1/external-snapshotter/commit/9382f1aaa6786b250e3d9353465d7c222b5f13c2 this way i am not sure if this is the correct approach or not, if yes i can make a PR from it.

Madhu-1 commented 8 months ago

cc @nixpanic

nixpanic commented 8 months ago

Calling the ListSnapshots CSI procedure should not be required. The RestoreSize of each snapshot is returned as part of the reply to the CreateGroupSnapshot CSI procedure (see repeated Snapshot snapshots = 2 in the spec).

Madhu-1 commented 8 months ago

@nixpanic sent https://github.com/kubernetes-csi/external-snapshotter/pull/1011 to fix it, PTAL