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

Add "catalog list" command #179

Merged
merged 3 commits into from
Sep 14, 2020

Conversation

chrisglass
Copy link
Contributor

@chrisglass chrisglass commented Sep 14, 2020

This commit adds the "commodore catalog list" command that will query
lieutenant for a list of available cluster IDs (and descriptions), and
display the information on stdout.

This partially helps with #135

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Update the documentation.
  • Update tests.
  • Update the ./CHANGELOG.md.
  • Link this PR to related issues.

Testing done

Unit tests have not been added since the logic is trivial (basically printing out contents of an already-existing API) and consists mostly of stiching side-effects. Mocking side-effects (the click library and lieutenant function call) would result it unit testing a for loop, which I suspect is not very interesting.

@srueg
Copy link
Contributor

srueg commented Sep 14, 2020

Nice addition, thanks for the contribution! 👍

May I suggest to add a -o/--output flag to optionally change the output format. This could include the option json to enable structured output to further processing, for example:

for catalog in $(commodore catalog list | jq -r '.[]'); do
  commodore catalog compile ${catalog};
done

Copy link
Member

@simu simu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution

docs/modules/ROOT/pages/reference/cli.adoc Outdated Show resolved Hide resolved
@chrisglass chrisglass force-pushed the add-catalog-list-command-rebased branch from a568a12 to 2900afc Compare September 14, 2020 12:13
This commit adds the "commodore catalog list" command that will query
lieutenant for a list of available cluster IDs (and descriptions), and
display the information on stdout.
@chrisglass chrisglass force-pushed the add-catalog-list-command-rebased branch from 2900afc to 96f1558 Compare September 14, 2020 12:14
Don't print out non-machine-readable information if the output is not
"verbose". By default, only the cluster IDs will be printed, allowing
scripted usage.
@srueg srueg merged commit a1b22f6 into projectsyn:master Sep 14, 2020
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.

3 participants