Fix panic on empty/sign-only --kubernetes-feature-gates - #18430
Fix panic on empty/sign-only --kubernetes-feature-gates#18430vigneshakaviki wants to merge 2 commits into
Conversation
|
Welcome @vigneshakaviki! |
|
Hi @vigneshakaviki. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Extract feature gate parsing into a separate parseFeatureGates function with proper input validation: - Guard against empty gate name at start of loop (was panic before) - Guard against empty name after stripping +/- prefix - Change to else-if to prevent double-processing Add comprehensive test table with 7 cases covering empty string, sign-only, and valid gate names with +/- prefixes. Signed-off-by: vigneshakaviki <kumarvignesh295@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
51cc1c7 to
2271726
Compare
|
|
Hi @vigneshakaviki, great work on extracting the feature gate parsing into its own function. This makes the logic much more testable. I reviewed the implementation and the use of a test table to cover the empty/sign-only edge cases is a solid approach to prevent regressions. great work. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
PR needs rebase. DetailsInstructions 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. |
Fixes #18407
Summary
Testing