Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Don't print JSON at the end of az capi create? #130

Open
mboersma opened this issue Jun 3, 2022 · 3 comments
Open

Don't print JSON at the end of az capi create? #130

mboersma opened this issue Jun 3, 2022 · 3 comments
Milestone

Comments

@mboersma
Copy link
Member

mboersma commented Jun 3, 2022

The idea was to show az capi show -n mycluster when the workload cluster is created. This prints out JSON by default, and is consistent with az create commands in general, which dump JSON.

But this JSON output which doesn't mesh well with the tidy checkbox messages az capi has printed out up until this point. Maybe we should print with -o table or skip this altogether.

Opinions?

@mboersma
Copy link
Member Author

mboersma commented Jun 3, 2022

The checkbox progress messages are going to stderr, so the only thing going to stdout is the cluster JSON. This seems like the right design from a UNIX-tool-oriented point of view, but conflicts with our "keep it super simple" goals.

@DannyBrito
Copy link
Contributor

The checkbox progress messages are going to stderr, so the only thing going to stdout is the cluster JSON. This seems like the right design from a UNIX-tool-oriented point of view, but conflicts with our "keep it super simple" goals.

I am not quite sure I follow. Do you mind elaborating?

@mboersma mboersma changed the title Don't print JSON at the end of az capi create Don't print JSON at the end of az capi create? Jun 3, 2022
@mboersma
Copy link
Member Author

mboersma commented Jun 3, 2022

All the progress messages with Spinner and human-readable log messages are printing to stderr, and the only thing that is printed to stdout is the object returned at the end of the create operation, in JSON by default.

This allows a user of az capi to redirect stderr to a log file (or /dev/null) and then have only the JSON data printed. This enables the command to be used in "the UNIX way," which generally means "commands that do one thing and can easily be piped into other commands." az overall takes this approach, printing out just JSON by default for all its az <foo> create commands.

az capi is following that pattern, but leaning very heavily on printing human-readable messages to stderr. So when the command finishes with the actual JSON of the cluster created, it's correct in terms of azure CLI design, but it is jarring and not user-friendly for a new user.

@mboersma mboersma added this to the v0.0.6 milestone Jun 13, 2022
@mboersma mboersma modified the milestones: v0.0.6, v0.1.0, v0.2.0 Dec 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants