robscott / kube-capacity

A simple CLI that provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster
Apache License 2.0
2.09k stars 114 forks source link

incorrect memory value then memory specified in decimal format #71

Closed cloud-66 closed 1 year ago

cloud-66 commented 2 years ago

bug #66 appears then memory request\limit specified in decimal format, so i think if we make format according typeResource everythink will be ok. But there are a few comments

  1. Request\Limits will be converted to BinarySi формат
  2. formatToMegiBytes function rounds up, not is the best way in all situation. Fore example 128M = 122,0703125 Mi , but function rounds it to 123Mi

before request memory = 128M limit memory = 512M image )

after request memory = 128M limit memory = 512M image )

cloud-66 commented 2 years ago

@robscott hello, can you please take a look on this PR ?

buckleyGI commented 1 year ago

We are hitting this issue as well. Too many zero's to parse for my human brain :)

robscott commented 1 year ago

Sorry for the delay on this! Thanks for the fix @cloud-66!