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

Invalid plugins names should return the help with the options available #1915

Closed
camilamacedo86 opened this issue Dec 17, 2020 · 3 comments · Fixed by #1937
Closed

Invalid plugins names should return the help with the options available #1915

camilamacedo86 opened this issue Dec 17, 2020 · 3 comments · Fixed by #1937
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented Dec 17, 2020

the current behaviour is:

 $ kubebuilder init --plugins -h
2020/12/17 12:14:53 invalid plugin name "-h": invalid plugin name "-h": [a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(\.[a-z0-9](?:[-a-z0-9]*[a-z0-9])?)*')]
$ kubebuilder init --plugins=go -h
2020/12/17 12:14:58 ambiguous plugin "go" for project version "3-alpha"

When I would expect to see always the options available Available plugins: ("go.kubebuilder.io/v2", "go.kubebuilder.io/v3") instead such as we have for projects:

    $ kubebuilder init --plugins=go/v2 -h
Initialize a new project.

For further help about a specific project version, set --project-version.

Usage:
  kubebuilder init [flags]

Examples:
  # Help for initializing a project with version "2"
  kubebuilder init --project-version="2" -h

  # Help for initializing a project with version "3-alpha"
  kubebuilder init --project-version="3-alpha" -h

Flags:
  -h, --help                     help for init
      --plugins strings          Name and optionally version of the plugin to initialize the project with. Available plugins: ("go.kubebuilder.io/v2", "go.kubebuilder.io/v3")
      --project-version string   project version, possible values: ("2", "3-alpha") (default "3-alpha")
@camilamacedo86 camilamacedo86 added the kind/bug Categorizes issue or PR as related to a bug. label Dec 17, 2020
@adikul30
Copy link

adikul30 commented Dec 19, 2020

Hi! Should v3 issues have a label of their own? Since the --plugins flag is not available in the init command for v2.3.1.

@camilamacedo86 camilamacedo86 added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jan 12, 2021
@camilamacedo86
Copy link
Member Author

probably the PR #1937 will solve this one too.

@Adirio
Copy link
Contributor

Adirio commented Jan 13, 2021

With #1937, the output to kubebuilder init --plugins -h is:

Error: invalid plugin name "-h": invalid plugin name "-h": [a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(\.[a-z0-9](?:[-a-z0-9]*[a-z0-9])?)*')]
Usage:
  kubebuilder [flags]

Examples:
The first step is to initialize your project:
    kubebuilder init --project-version=<PROJECT VERSION> --plugins=<PLUGIN KEYS>

<PLUGIN KEYS> is a comma-separated list of plugin keys from the following table
and <PROJECT VERSION> a supported project version for these plugins.

          Plugin keys | Supported project versions
----------------------+----------------------------
 go.kubebuilder.io/v2 |                 2, 3-alpha
 go.kubebuilder.io/v3 |                    3-alpha

For more specific help for the init command of a certain plugins and project version
configuration please run:
    kubebuilder init --help --project-version=<PROJECT VERSION> --plugins=<PLUGIN KEYS>

Default project version: 3-alpha
Default plugin keys: "go.kubebuilder.io/v3"

After the project has been initialized, run
    kubebuilder --help
to obtain further info about available commands.

Flags:
  -h, --help                     help for kubebuilder
      --plugins strings          plugin keys of the plugin to initialize the project with
      --project-version string   project version (default "3-alpha")

2021/01/13 07:38:45 invalid plugin name "-h": invalid plugin name "-h": [a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(\.[a-z0-9](?:[-a-z0-9]*[a-z0-9])?)*')]

Should this be enough? Any suggested changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants