-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
refact(size): conversion G to Gi #59
Conversation
Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
=======================================
Coverage 53.72% 53.72%
=======================================
Files 12 12
Lines 631 631
=======================================
Hits 339 339
Misses 272 272
Partials 20 20 Continue to review full report at Codecov.
|
@prateekpandey14 for the requested 1G we are giving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes are good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR seems to be making size always in GiB.. but, size can be in other units as well like TiB
Need testcases as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that this is how k8s as well is doing same. Hence, approving.
Please add testcases at earliest
fixes the
G
tobytes
toGi
conversion while trasitioning from PVC to CVC storage capacity the way kubernetes handles, by converting to Gi form.here is the example link for the same https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider/volume/helpers/rounding.go
Note:
RoundUpSize calculates how many allocation units are needed to accommodate a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS,GKE etc allocates volumes in gibibyte-sized chunks.
RoundUpSize(1500 * 10241024, 10241024*1024) returns '2'
(2 GiB is the smallest allocatable volume that can hold 1500MiB)
Signed-off-by: prateekpandey14 prateekpandey14@gmail.com