Skip to content
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

Merged

Conversation

estroz
Copy link
Contributor

@estroz estroz commented May 31, 2020

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 the cmdErr idiom used by other command setups for uniform error reporting.

/cc @camilamacedo86 @joelanford @mengqiy

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 31, 2020
@estroz
Copy link
Contributor Author

estroz commented May 31, 2020

/test pull-kubebuilder-e2e-k8s-1-16-2

Copy link
Member

@camilamacedo86 camilamacedo86 left a 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.

@estroz
Copy link
Contributor Author

estroz commented Jun 1, 2020

@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.

Copy link
Member

@camilamacedo86 camilamacedo86 left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit 6480d5a into kubernetes-sigs:master Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants