-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Adding utils.format_quantity #2216
base: master
Are you sure you want to change the base?
Conversation
Welcome @rkschamer! |
/kind feature |
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.
I couldn't find any tests for the utils modules, neither the parse_quantity function. I'd be very happy to add some tests for format_quantity, but so far I just didn't find the right place for them. Please let me know where I should put them.
You could use https://github.com/kubernetes-client/python/blob/master/kubernetes/e2e_test/test_utils.py
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rkschamer The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Perfect, thank you. I've now added the tests for With the tests, I now consider my change as ready for review and hence, I've also changed to an actual PR. |
Hi @roycaihw, I don't want to be pushy, but do you think, you can have a look on the PR? Thank you, |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
What type of PR is this?
/kind feature
What this PR does / why we need it:
PR adds a
utils.format_quantity
, which converts a decimal number into a canonical kubernetes quantity.There is already
utils.parse_quantity
which I used in my project, but I also needed a way to convert aDecimal
number back into a Kubernetes quantity. This PR proposes to add this functionality to the Python K8s client.Which issue(s) this PR fixes:
Fixes #2205
Special notes for your reviewer:
I couldn't find any tests for the
utils
modules, neither theparse_quantity
function. I'd be very happy to add some tests forformat_quantity
, but so far I just didn't find the right place for them. Please let me know where I should put them.Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: