Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decode base64-encoded fields during output
Closes #247 Related to linode/linode-api-docs#468 The API returned kubeconfigs as a base64-encoded YAML string. The linked docs PR uses the appropriate JSON Schema fields to note the encoding and actual media type, and this CLI PR adds support for that information and handling it. However, the output for `linode-cli lke kubeconfig-view $CLUSTER_ID` is _pretty terrible_ with this change. The `token` and `certificate-authority-data` fields are _very long_, and cause wrapping in the terminal, which messes up the entire output table. This can be corrected by using `--text` as the output format, which, paired with `--no-headers`, produces a nicely-formatted YAML file as output; the default behavior being ugly isn't great in my opinion though. This change isn't strictly necessary, as a user can run `linode-cli lke kubeconfig-view $CLUSTER_ID --text --no-headers | base64 -d` to see the same output today; however, having the default output be useful would be a nice touch. I see the following options here: * Accept that the current output is fine and do not merge this PR * Accept that this PR's output is ugly by default and merge it anyway * Come up with a way to signal to the CLI that an operation should default to `--text --no-headers`-style output as part of this PR. This change probably also represents a breaking change for the CLI, as an existing script that does the decoding as noted above would stop working with this change merged in. Opinions appreciated; I will close/open/update this PR as relevant based on discussion here.
- Loading branch information