fix: converters reject signed resource values to match validator behavior#1588
Open
immanuwell wants to merge 1 commit into
Open
fix: converters reject signed resource values to match validator behavior#1588immanuwell wants to merge 1 commit into
immanuwell wants to merge 1 commit into
Conversation
…vior Signed-off-by: immanuwell <pchpr.00@list.ru>
5be510d to
3ffab33
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1588 +/- ##
=====================================
Coverage 80.7% 80.7%
=====================================
Files 62 62
Lines 5081 5081
Branches 771 771
=====================================
Hits 4101 4101
Misses 846 846
Partials 134 134 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Description of PR
Currently,
_convert_decimal_unitsand_convert_binary_unitsaccept signed values like-500mor+1Gidue to[+-]?in their regex patterns. The validators (_validate_decimal_units,_validate_binary_units) correctly reject these, so there's a mismatch - same input, different outcome depending on which function you hit first.This PR removes
[+-]?from both converter patterns so they're consistent with validators. Also fixes_merge_dictsraising bareExceptioninstead ofValueError.Reproduce:
Negative resource values aren't valid in Kubernetes anyway, so rejecting them in both layers makes sense.