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

[Capact CLI] Add support for jsonpath output #614

Closed
mszostok opened this issue Jan 25, 2022 · 0 comments
Closed

[Capact CLI] Add support for jsonpath output #614

mszostok opened this issue Jan 25, 2022 · 0 comments
Labels
area/cli Relates to CLI area/documentation Related to all activities around documentation enhancement New feature or request
Milestone

Comments

@mszostok
Copy link
Member

mszostok commented Jan 25, 2022

Description

Currently, in most of our tutorials/documentations, we require from user to install the jq tools For example:

capact typeinstance get {type-instance-id} -ojson | jq -r '.[0].latestResourceVersion.spec.value'

this can be simply replaced with:

capact typeinstance get {type-instance-id} -ojsonpath='.[0].latestResourceVersion.spec.value'

After #489 it would be as simple as:

capact typeinstance get {type-instance-id} -ojsonpath='.spec.value'

We can re-use solution implemented in kubectl:
https://github.com/kubernetes/cli-runtime/blob/e2af539b53266cfd3ee268922d3027f83de1e80a/pkg/printers/jsonpath.go#L139-L145

Reason

Requires installation of external tools for most of the happy path scenarios. This should be simplified and Capact CLI should be the only one which is needed. One 💍 to rule them all 😎 . Same as we did for #328 and #466.

Use cases

  • Capact User—installation of Capact CLI is sufficient to follow our tutorials and documentation

Acceptance Criteria

  • Tutorials and documentations are updated
  • Capact CLI supports jsonpath output for all commands
@mszostok mszostok added enhancement New feature or request area/cli Relates to CLI area/documentation Related to all activities around documentation labels Jan 25, 2022
@mszostok mszostok added this to the Next milestone Jan 25, 2022
@mszostok mszostok changed the title [Capact CLI] Add support jsonpath output [Capact CLI] Add support for jsonpath output Jan 25, 2022
@mszostok mszostok modified the milestones: Next, 0.7.0 May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Relates to CLI area/documentation Related to all activities around documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants