vmware-tanzu / tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Apache License 2.0
194 stars 192 forks source link

Include a flag for machine-readable output as a part of the management-cluster command #7

Open zjs opened 3 years ago

zjs commented 3 years ago

Describe the feature request

The TCE getting started guide has the user run tanzu management-cluster get to print a bunch of information about the management cluster, and then copy & paste the management cluster name.

It'd be nice if the management-cluster plugin provided a flag for JSON output (like other plugins do) so that the user could do something a like export MGMT_CLUSTER_NAME=$(tanzu management-cluster get -o jsonpath={…}).

Describe alternatives you've considered

None — and there may be better ways to solve this!

Affected product area (please put an X in all that apply)

Additional context

stmcginnis commented 3 years ago

This is partially addressed with using https://github.com/vmware-tanzu/tanzu-framework/blob/3ff281803db15a87a950be07b949351817bf26d7/pkg/v1/cli/component/output.go, but we need to restructure the current output. Right now it is a mix, so even when specifying a yaml or json format, there are parts of the output emitted that would need to be parsed out.