-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
pkg/cli: use cmd error idiom for 'init' and plugin keys in cmd errors #1540
pkg/cli: use cmd error idiom for 'init' and plugin keys in cmd errors #1540
Conversation
…ames in cmd error
/test pull-kubebuilder-e2e-k8s-1-16-2 |
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.
IMO this error should NOT occur at all. Note that c.resolvedPlugins
will return all supported plugins for the PROJECT version which can be, for example: go.kubebuilder.io/v3.0.0, go.kubebuilder.io/v3.1.0, go.kubebuilder.io/v3.2.0
Then, I understand that was defined that we should use the upper version in this scenario.
Note that the issue is NOT faced at the moment by the CI because KB has just 1 plugin version implemented currently. But the Issue is tracked in #1526.
@camilamacedo86 which error are you talking about, the duplicate error or not-found error? The duplicate error will happen if a user specifies an ambiguous key that doesn't correspond to a default plugin. The not-found error will happen if a user specifies a key that doesn't correspond to an existing plugin. |
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.
After our chat, I am ok with move forward with it.
It is
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, estroz 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 |
Instead of only using plugin names in command errors, keys should be used for more informative error messages. An action should be suggested in the error message as well.
Additionally, the
init
command setup should use thecmdErr
idiom used by other command setups for uniform error reporting./cc @camilamacedo86 @joelanford @mengqiy