Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing PVC response in GB, MB and KB too #1165

Open
GunaKKIBM opened this issue Feb 25, 2024 · 0 comments
Open

Publishing PVC response in GB, MB and KB too #1165

GunaKKIBM opened this issue Feb 25, 2024 · 0 comments

Comments

@GunaKKIBM
Copy link

GunaKKIBM commented Feb 25, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant