Description
What is the feature and why do you need it:
There is parse_quantity
to convert a canonical K8s quantity into a Decimal
value. However, an opposite function, like format_quantity
is missing, making it hard to transform a Decimal into a K8s quantity.
My use case was that I needed to load the resource requirements of serval pods, finding the maximum value and setting it for all pods. Due to potentially different SI suffixes, I've used parse_quantity
, however setting the resource requirements for all other Pods, requires me to convert back from a Decimal
into a canonical K8s quantity.
Describe the solution you'd like to see:
So far, I've implemented the function in my project, but I think that might be something also others could benefit. For this reason, I'd like to open a pull request to contribute this function.
### Tasks