-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
cpuset parsing:Fix more edge cases and add more unit tests #100565
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @lack! |
Hi @lack. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rphillips @haircommander ptal |
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.
/ok-to-test
// Non-numeric entries | ||
"nonnumeric", "non-numeric", "no,numbers", "0-a", "a-0", "0,a", "a,0", "1-2,a,3-5", | ||
// Incomplete sequences | ||
"0,", "0,,", ",3", ",,3", "0,,3", |
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.
nit: these are all supported by the kernel, since it just ignores extra commas. Not sure if we should care tho.
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.
This cpuset format is consumed by others too, like kubelet and cri-o, so perhaps it's worth being more picky.
/retest |
/priority important-longterm |
/assign @odinuge |
Change looks overall good to me, but I still don't think we should drop support for ranges where the first and last number is the same (eg. |
The cpuset.Parse function missed a couple bad input cases, specifically "1--3" and "10-6". These were silently ignored when they should instead be flagged as invalid. This now catches these cases and expands the unit tests for cpuset to cover them (and other negative test cases as well). Signed-off-by: Jim Ramsay <jramsay@redhat.com>
Just updated to re-allow these ranges. |
These failures seem unrelated to my change. |
@odinuge: I think this is ready for review again, if you have a chance! |
/uncc |
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.
/lgtm
/assign @derekwaynecarr |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lack, mrunalp, odinuge The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The cpuset.Parse function missed a couple bad input cases, specifically
1--3
and10-6
. These were silently ignored when they should instead be flagged as invalid.This now catches these cases and expands the unit tests for cpuset to cover them (and other negative test cases as well).