Velero: Add -o CLI flag to documentation

Created on 3 Jun 2019  ·  7Comments  ·  Source: vmware-tanzu/velero

Describe the solution you'd like
It would be useful to be able to change the output format of the Velero CLI so that the CLI can be used in higher-level orchestration tools and scripts.

Anything else you would like to add:
Something similar to the kubectl output options would probably meet a wide range of use cases.

Environment:

  • Velero version (use velero version): v1.0.0
  • Kubernetes version (use kubectl version): version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T18:55:03Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
  • Kubernetes installer & version: Google Cloud SDK
  • Cloud provider or hardware configuration: GCP/GKE
  • OS (e.g. from /etc/os-release): OSX 10.14.5
Question

Most helpful comment

IMO it's more useful directly on the subcommands than on velero itself, which doesn't really do anything. So I'd agree we don't need to do anything.

All 7 comments

As I finished typing this I realised there's already a pretty good way to do this: output the CRD directly from kubectl.

🤦‍♂️

e.g. to list the most recent backup:

✗ kubectl get backups.velero.io --sort-by=.metadata.creationTimestamp -o jsonpath="{.items[-1].metadata.name}
daily-prod-backup-20190603040038

This handles my use-case so I'm closing this issue.

FYI - you can also do velero backup get -o yaml or velero backup get -o json :)

@skriss - that's probably tidier. There's no mention of it in the documentation or velero --help, any chance it could be added (and any other undocumented flags)?

It's documented in the help for the specific commands (velero backup get --help). We can see if there's a place in the docs site where that would belong.

@nrb @carlisia @prydonius do you think we need to document this any further? On reflection I think it's properly documented in the CLI help text, so I'm not sure there's anything else to do here.

IMO it's more useful directly on the subcommands than on velero itself, which doesn't really do anything. So I'd agree we don't need to do anything.

Fine by me; I think this was really my mistake in not looking at the specific command's help text.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitobotta picture vitobotta  ·  3Comments

my1990 picture my1990  ·  3Comments

totemcaf picture totemcaf  ·  4Comments

abh picture abh  ·  4Comments

Berndinox picture Berndinox  ·  3Comments