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 -o CLI flag to documentation #1536

Closed
dijitali opened this issue Jun 3, 2019 · 7 comments
Closed

Add -o CLI flag to documentation #1536

dijitali opened this issue Jun 3, 2019 · 7 comments

Comments

@dijitali
Copy link

dijitali commented Jun 3, 2019

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
@dijitali
Copy link
Author

dijitali commented Jun 3, 2019

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.

@dijitali dijitali closed this as completed Jun 3, 2019
@skriss
Copy link
Member

skriss commented Jun 3, 2019

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

@dijitali
Copy link
Author

dijitali commented Jun 4, 2019

@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)?

@dijitali dijitali reopened this Jun 4, 2019
@dijitali dijitali changed the title Feature Request: Add CLI option to change output format Add -o CLI flag to documentation Jun 4, 2019
@skriss
Copy link
Member

skriss commented Jun 4, 2019

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.

@skriss
Copy link
Member

skriss commented Jul 22, 2019

@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.

@nrb
Copy link
Contributor

nrb commented Jul 22, 2019

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.

@dijitali
Copy link
Author

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

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

No branches or pull requests

3 participants