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

[BUG] `tele ls --format short` reports "[ERROR]: unknown output format "short", supported are: [text short json yaml]" #1816

Open
wadells opened this issue Jun 30, 2020 · 1 comment

Comments

@wadells
Copy link
Member

@wadells wadells commented Jun 30, 2020

Describe the bug

$ tele version
Edition:        enterprise
Version:        7.1.0-alpha.1.113
Git Commit:     39432eb08f243f101c11807923832e487e67fef3
Helm Version:   v2.15
$ tele ls --format short --hub=<redacted> --token=<redacted>
Displaying latest stable versions of application and cluster images in <redacted>. Use --all flag to show all.

[ERROR]: unknown output format "short", supported are: [text short json yaml]
$ tele ls --help
usage: tele ls [<flags>]

List cluster and application images published to Gravity Hub.

Flags:
      --help                 Show context-sensitive help (also try --help-long and --help-man).
      --debug                Enable debug mode.
      --insecure             Skip TLS verification when making HTTP requests.
      --state-dir=STATE-DIR  The build cache directory to speed up subsequent builds. Defaults to ~/.gravity.
      --hub=HUB              Address of the Gravity Hub to execute the command against. Defaults to the currently active cluster or the Gravitational distribution portal.
  -t, --token=TOKEN          Gravity authentication token.
      --format=text          Output format: [text short json yaml].
      --all                  Display all available versions.

Expected behavior

I expect the --help documentation and error message to match the behavior. Short should be removed as an format option, or work properly when provided.

Environment (please complete the following information):

  • OS [e.g. Redhat 7.4]: Ubuntu 20.04
  • Gravity [e.g. 5.5.4]: 7.1.0-alpha.1, master
  • Platform [e.g. Vmware, AWS]: desktop

Additional Info

--format short isn't anywhere in the online documentation

@wadells
Copy link
Member Author

@wadells wadells commented Jun 30, 2020

Aside: the error message providing the accepted formats is good UX. We re-implement this error a couple times. It'd be good to make sure all the following tell the end user what the acceptable formats are.

walt@work:~/git/gravity$ rg -A1 'unknown output format'
lib/catalog/lister.go
259:            return trace.BadParameter("unknown output format %q, supported are: %v",
260-                    format, constants.OutputFormats)

tool/gravity/cli/plan.go
184:            return trace.BadParameter("unknown output format %q", format)
185-    }

tool/gravity/cli/site.go
217:            return trace.BadParameter("unknown output format: %s", outFormat)
218-    }

e/tool/gravity/cli/cluster.go
60:             return trace.BadParameter("unknown output format: %s", outFormat)
61-     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.