-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🐛Add deprecation message to clusterctl commands #1439
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
Conversation
|
Welcome @wfernandes! |
|
Hi @wfernandes. Thanks for your PR. I'm waiting for a kubernetes-sigs or 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. |
| Command "create" is deprecated, clusterctl has been deprecated in v1alpha2 and will be removed in a future version. | ||
| Error: unknown flag: --invalid-flag | ||
| Usage: | ||
| clusterctl create [command] |
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.
I don't necessarily mind this diff, but this could cause issues for users of clusterctl in that the usage does not actually show the deprecated subcommands now.
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.
I had the same feeling about degrading the user experience of clusterctl --help commands.
The behavior of kubectl run only shows the deprecation message when executing the command and not in any help or usage output. We can follow the same behavior, however I feel it would be useful to display the deprecation message as part of the help output. I have another solution where we use a custom help template. I'll re-submit the PR and we can see how that feels.
Signed-off-by: Warren Fernandes <[email protected]>
| Run: func(cmd *cobra.Command, args []string) { | ||
| if do.KubeconfigPath == "" { | ||
| exitWithHelp(cmd, "Please provide kubeconfig file for cluster to delete.") | ||
| exitWithHelp(cmd, "Please provide kubeconfig file for cluster to delete.\n") |
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.
I added these newlines so that the output would be easier to read.
$ ./clusterctl delete cluster
Please provide kubeconfig file for cluster to delete.
NOTICE: clusterctl has been deprecated in v1alpha2 and will be removed in a future version.
Delete a kubernetes cluster with one command
...
|
I updated the PR such that the deprecation message would show when a command is ran and also during the help. |
|
/ok-to-test |
vincepri
left a comment
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.
/ok-to-test
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: detiber, vincepri, wfernandes 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 |
Signed-off-by: Warren Fernandes [email protected]
What this PR does / why we need it:
Add deprecation message to each clusterctl command
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #1423
NOTES
A side effect of setting the
Deprecatedproperty oncobra.Commandis that in the--helpof the commands, it does not list the available sub-commands. The sub-commands will still run and print out the deprecation message at the top. Scripts/automation will not break.