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
Add diff command return status code greater than 1 when flags invalid #105445
Add diff command return status code greater than 1 when flags invalid #105445
Conversation
This PR adds flagerror handler function to detect when flags are invalid. Default flag handler returns status code 1. However, diff command embraces this status code as changes are found. By overriding flag errors, this PR shows same message with default case and returns status code 2.
@ardaguclu: 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/test-infra repository. |
Hi @ardaguclu. 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. |
@eddiezane @brianpursley Could you PTAL?, thanks. |
@ardaguclu thanks for the fix. This looks fine to me. Can you please add a test to catch regression here? This might help since it looks like https://cs.k8s.io/?q=NewCmd&i=nope&files=_test.go&excludeFiles=&repos=kubernetes/kubectl |
@eddiezane thanks for review. I spent some time to add tests using the link you provided. However,
method did not call Maybe this problem is also the reason why there is also no unit test in this usage
|
@pacoxu you moved this PR to backlog, but I think there is no elegant way to write unit tests for this case without applying some hacky methods. |
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.
/approve
Thanks for taking a look at the tests!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, eddiezane 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 |
/lgtm |
/release-note-edit
|
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR adds flagerror handler function to detect when flags are invalid.
Default flag handler returns status code 1. However, diff command embraces
this status code as changes are found. By overriding flag errors,
this PR shows same message with default case and returns status code 2.
Which issue(s) this PR fixes:
Fixes #99354
Special notes for your reviewer:
Does this PR introduce a user-facing change?