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

kudo get cmd help #1674

Merged
merged 3 commits into from
Sep 4, 2020
Merged

kudo get cmd help #1674

merged 3 commits into from
Sep 4, 2020

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented Sep 3, 2020

What this PR does / why we need it:

Update to provide proper help messaging for the get command at the root level and at the get level

go run cmd/kubectl-kudo/main.go -h
KUDO CLI and future sub-commands can be used to manipulate, inspect and troubleshoot KUDO-specific CRDs
and serves as an API aggregation layer.

Usage:
  kubectl-kudo [command]

Examples:
...
  # Get instances
  kubectl kudo get instances [flags]

Available Commands:
  diagnostics collect diagnostics
  get         Gets list of installed components (instances, operators, operatorversions or all).


Flags:
  -h, --help                  help for kubectl-kudo
      --home string           Location of your KUDO config. (default "/Users/kensipe/.kudo")
...
Use "kubectl-kudo [command] --help" for more information about a command.

and

go run cmd/kubectl-kudo/main.go get -h
Gets list of installed components (instances, operators, operatorversions or all).

Usage:
  kubectl-kudo get <instances|operators|operatorversions|all> [flags]

Examples:
  # Get all available instances
  kubectl kudo get instances

  # Get all available operators
  kubectl kudo get operators

  # Get all available operatorversions
  kubectl kudo get operatorversions

  # Get all installed components
  kubectl kudo get all

  # Get all installed components as yaml
  kubectl kudo get all -o yaml


Flags:
  -h, --help            help for get
  -o, --output string   Output format. One of: json|yaml

Global Flags:
      --home string           Location of your KUDO config. (default "/Users/kensipe/.kudo")
      --kubeconfig string     Path to your Kubernetes configuration file. (default "/Users/kensipe/.kube/config")
  -n, --namespace string      Target namespace for the object. (default "default")
      --request-timeout int   Request timeout value, in seconds.  Defaults to 0 (unlimited)
  -v, --v 0                   Log level for V logs
      --validate-install      Validate KUDO installation before running. (default true)

Fixes #1673

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that lgtm!

Comment on lines +77 to +78
fmt.Fprintf(opts.Out, "List of current installed %s in namespace %q:\n", args[0], opts.Namespace)
fmt.Fprintln(opts.Out, tree.String())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is marked as a warning in my Goland/IntelliJ - Looks like we don't have that as a linting rule. I'm ok with either, tbh.

@kensipe kensipe merged commit 8c30604 into main Sep 4, 2020
@kensipe kensipe deleted the ken/get-cmd-help branch September 4, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KUDO Get Command Incorrect
3 participants