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
OCM-6391 | fix: Fixed bug where deprecation shows for parent cmd #1931
Conversation
/lgtm |
1 similar comment
/lgtm |
/retest |
/retest |
did not print deprecation msg on usage of cmds, added manually to each run command in the same func, now prints when running the deprecated cmds |
acb5884
to
8524485
Compare
8524485
to
541960a
Compare
@hunterkepley: all tests passed! Full PR test history. Your PR dashboard. 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1931 +/- ##
=======================================
Coverage 21.69% 21.69%
=======================================
Files 118 118
Lines 19797 19804 +7
=======================================
+ Hits 4294 4297 +3
- Misses 15181 15186 +5
+ Partials 322 321 -1 ☔ View full report in Codecov by Sentry. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidleerh, gdbranco, hunterkepley, marcolan018 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 |
This change is breaking json outputs as the message is always printed:
|
command.Parent().HelpFunc()(command, strings) | ||
}) | ||
currentRun := cmd.Run | ||
cmd.Run = func(c *cobra.Command, args []string) { | ||
_, _ = fmt.Fprintf(os.Stdout, "%s%s\n", "\u001B[0;33mW:\u001B[m ", regionDeprecationMessage) |
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.
We can check if output flag is being requested before printing
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.
OCM-6391 is a previously finished ticket which had a small bug, it is now fixed. The deprecation msg was showing up in parent cmds, when it was only meant to show up in certain subcommands. This MR fixes that