kubernetes-csi/external-provisioner

Publishing PVC response in GB, MB and KB too

GunaKKIBM opened this issue · 4 comments

Currently, if the user provides input for pvc creation in Kilobytes, Gigabytes, Megabytes (10^3, 10^6, 10^9) and the respective cloud provider creates the same in GB and returns response, it would be better if csi provisioner has the capability to convert the response published in pvc to GB accordingly. Elaborating more with an example

Cloud provider could created the volume in either Gibibytes (1024 * x), or Gigabytes (1000 *x) and send the response to csi provisioner accordingly.
Example:
Current behavior
If the response sent by csi driver of the cloud provider is - 100000000000 bytes, currently the response published is - 97656250Ki which is derived from the code,

quantity := resource.NewQuantity(bytes, resource.BinarySI)
.

Expected and more readable response: 100G

  1. Rather than publishing unreadable value, it would better to figure out whether the response returned to csi provisioner from driver is in 1024 ^ x, or 1000 ^ x, accordingly use Binary or Decimal constants - https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#pkg-constants and publish the response so that correct value is seen in pvc.
    OR
  2. Provide a parameter in CreateCSIVolumeResponse where the cloud provider can provide the units in which they want the response to be published which provides driver with more control.

quantity := resource.NewQuantity(bytes, resource.BinarySI)

Thank you!

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale