Repository navigation
fix: normalize quantity overflow errors - #2737
kubernetes-prow[bot] merged 2 commits into
Conversation
|
Welcome @KeuqS! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KeuqS, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0c34031
into
kubernetes-client:master
/kind bug
What this PR does / why we need it:
Normalize decimal overflow errors raised by parse_quantity into ValueError so callers get a consistent exception type for malformed or unrepresentable quantities.
The implementation catches DecimalException only around the scaled multiplication. Existing valid quantities and other validation behavior remain unchanged.
Which issue(s) this PR fixes:
Fixes #2735
Special notes for your reviewer:
Added a regression test for the overflowing quantity 2.e388635141Ki. No Kubernetes cluster is required to reproduce or test this behavior.
Does this PR introduce a user-facing change?
No. This makes the exception type consistent for invalid input.