Description of problem: volumesnapshotconent RESTORESIZE is not a human readable way Version-Release number of selected component (if applicable): 4.7.0-0.nightly-2020-12-17-201522 How reproducible: Always Steps to Reproduce: 1. Create a volumesnapshot object with: $ cat snapshot.yaml apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshot metadata: name: mysnapshot spec: volumeSnapshotClassName: csi-snapshotclass source: persistentVolumeClaimName: test-pvc-6 $ oc get volumesnapshotsnapshot $ oc get volumesnapshotcontent NAME READYTOUSE RESTORESIZE DELETIONPOLICY DRIVER VOLUMESNAPSHOTCLASS VOLUMESNAPSHOT AGE snapcontent-986f25b5-e282-44be-8961-3a1389783c82 true 3221225472 Delete ebs.csi.aws.com csi-snapshotclass mysnapshot 12s Actual results: RESTORESIZE is 3221225472 Expected results: RESTORESIZE is the same with pvc capacity: 3Gi $ oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE test-pvc-6 Bound pvc-a40d2f9a-e986-42ad-93e3-0bfbfbb67ac9 3Gi RWO gp2-csi-immediate 5m25s Additional info:
I've looked into this a bit further. The underlying reason for the discrepancy is the API type: VolumeSnapshotStatus definition: RestoreSize *resource.Quantity `json:"restoreSize,omitempty" protobuf:"bytes,4,opt,name=restoreSize"` VolumeSnapshotContentStatus definition RestoreSize *int64 `json:"restoreSize,omitempty" protobuf:"bytes,3,opt,name=restoreSize"` When we use `oc get` we're simply displaying the value stored in the object. In addition, we can't perform any calculations through the `kubebuilder:printcolumn` that is used to display these values with `oc get`. The value in the content is directly from the CSI driver, and we're simply reporting it here. I'm going to close this as WONTFIX for the time being. The VolumeSnapshot is designed for the user (and is reporting in a human-readable format), whereas the VolumeSnapshotContent should only be used by admins, and we don't have a way to cleanly present the value at this time.