-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Fix label selector parsing for consecutive commas #133419
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
base: master
Are you sure you want to change the base?
Fix label selector parsing for consecutive commas #133419
Conversation
Allow parsing of expressions like 'x in (a,,)' by removing unnecessary token consumption in parseIdentifiersList. Previously, when encountering consecutive commas in selector value lists, the parser would incorrectly consume an extra comma token, causing 'expected identifier' errors. This change removes the p.consume(Values) call on line 851 that was preventing proper handling of empty values in selector lists while maintaining correct comma handling. Added test case "x in (a,,)" to verify the fix works correctly.
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Aug 7 03:00:08 UTC 2025. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Xdynix 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 |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
Welcome @Xdynix! |
Hi @Xdynix. 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-sigs/prow repository. |
/ok-to-test |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes label selector parsing to correctly handle consecutive commas in value lists (e.g.,
x in (a,,)
). Previously, when encountering two consecutive commas immediately followed by a closing parenthesis, the parser would consume the second comma incorrectly, skipping over the,)
case and resulting in an “expected identifier” error. This prevented valid expressions from being parsed successfully.Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: