Repository navigation
OCPBUGS-148312: Fix space-separated CLI flag parsing for filter options - #627
Durgesh-Bendale wants to merge 1 commit into
Conversation
Normalize --key value into --key=value for value-required flags before parse_args so oc netobserv accepts both syntaxes. Fixes OCPBUGS-148312. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
[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 |
|
Hi @Durgesh-Bendale. Thanks for your PR. I'm waiting for a netobserv 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. |
|
Verification Results Verified the fix by testing the --protocol flag with both space separated and = syntax. Before the changes: After the changes: Tested with space separated syntax: |
|
/Verified by me |
|
@Durgesh-Bendale: Jira verification commands are restricted to collaborators for this repo. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@Durgesh-Bendale: This pull request references Jira Issue OCPBUGS-148312, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
cc @jpinsonneau |
yes it's mentionned in the PR description. Depending on when we merge #605 we can integrate that first or rework it after 😸 I'm fine with both approach |
Summary
--protocol TCP) the same as equals form (--protocol=TCP) by normalizing value-required options beforeparse_args.--dropsand--backgroundare unchanged.Root cause
parse_argsonly splits each argv token on=. With--protocol TCP,TCPis a separate token and is rejected as an invalid option. The collectoroptionStrpath had the same tokenization issue.Changes
VALUE_REQUIRED_FLAGS,is_value_required_flag, andnormalize_optionsinscripts/functions.sh.parse_argsto callnormalize_optionsfirst.Test plan
./build/oc-netobserv packets --protocol TCP --port 8080 --yaml→filter_protocol=TCP, optionsprotocol=TCP|port=8080|yaml./build/oc-netobserv packets --protocol=TCP --port=8080 --yamlstill works./build/oc-netobserv flows --protocol UDP --port 53 --yamlworks (space form)./build/oc-netobserv flows --protocol=UDP --port=53 --yamlstill works--protocol FOO) still rejectedmake oc-commandsembeds fix inbuild/oc-netobservNotes
=-only filter parsing insplitFilterArgs; this fixes the current bash plugin.