Re: [kubernetes/kubernetes] jsonpath template output should be json (#16707)

3 views
Skip to first unread message

Michail Kargakis

unread,
Jun 10, 2017, 12:00:13 PM6/10/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@kubernetes/sig-cli-misc


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

fejta-bot

unread,
Dec 26, 2017, 10:29:27 PM12/26/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

fejta-bot

unread,
Jan 25, 2018, 10:38:04 PM1/25/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

fejta-bot

unread,
Feb 24, 2018, 11:23:34 PM2/24/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.


Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

k8s-ci-robot

unread,
Feb 24, 2018, 11:23:35 PM2/24/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Closed #16707.

Tim Malone

unread,
Mar 6, 2019, 11:02:00 PM3/6/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/reopen

Kubernetes Prow Robot

unread,
Mar 6, 2019, 11:02:14 PM3/6/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@tdmalone: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Luis Davim

unread,
May 13, 2019, 11:08:40 AM5/13/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I agree this should be /reopen

Tim Malone

unread,
May 13, 2019, 6:08:41 PM5/13/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@mikedanese Any possibility of reopening this?

Mike Danese

unread,
May 13, 2019, 6:29:49 PM5/13/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Reopened #16707.

fejta-bot

unread,
Aug 11, 2019, 6:32:27 PM8/11/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Luis Davim

unread,
Aug 12, 2019, 1:04:17 PM8/12/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/remove-lifecycle stale

Danil Smirnov

unread,
Oct 24, 2019, 8:07:51 AM10/24/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Can we have this implemented?


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Chew Choon Keat

unread,
Oct 31, 2019, 8:04:02 PM10/31/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

in the meantime...

- kubectl get no -o jsonpath="{.items}"
+ kubectl get no -o json | jq ".items"

Danil Smirnov

unread,
Nov 1, 2019, 3:59:56 AM11/1/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

in the meantime...

- kubectl get no -o jsonpath="{.items}"
+ kubectl get no -o json | jq ".items"

Sorry but I don't want to add jq dependency into my container.

And jsonpath is quite different language than jq, so you can not "just change" -o jsonpath= to -o json as in your example, you have to translate the query as well.

Beck

unread,
Dec 5, 2019, 3:59:04 AM12/5/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

guess i'll just move to :D
but anyway bump, it should have output as json or have at least an option to do so

AJ Escalera

unread,
Dec 10, 2019, 11:38:55 AM12/10/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

+1

This would be incredibly helpful as it would allow for custom object creation without requiring external de/serialization (eg via a program written in go, java).

For example, if I wanted to grab a bunch of options in a pod or pod template and analyze them to see if I needed to update the object, it is much easier and more maintainable for automation (eg via ansible) to be written in shell and use kubectl with jsonpath, than to require the user to write a program for parsing specific objects.

fejta-bot

unread,
Mar 9, 2020, 1:04:38 PM3/9/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Danil Smirnov

unread,
Mar 14, 2020, 3:58:58 AM3/14/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/remove-lifecycle stale

Tim Hockin

unread,
Mar 16, 2020, 7:51:38 PM3/16/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@kubernetes/sig-cli-bugs This is still an issue - jsonpath formatting for a non-primitive type is Go's weird printing syntax (blech)

Kubernetes Prow Robot

unread,
Apr 29, 2020, 1:56:49 AM4/29/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Closed #16707 via #89660.

Timofei Larkin

unread,
Sep 25, 2020, 6:09:41 AM9/25/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I think it's a misconception to call jsonpath an output format. It's a form of query. I should be able to do something like

k get resource --jsonpath='{.some.sub.path}' -o yaml

Andrei Belov

unread,
May 18, 2021, 8:50:12 AM5/18/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

agree with @lllamnyp.
A good example of that would be aws-cli with both --query AND --output available.

red8888

unread,
Feb 23, 2022, 8:32:29 PM2/23/22
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

This should at least be toggle-able. I can think of plenty of use cases where you want to parse kubectl output and send it along as structured data (json) so some other system/function.

Seems like this is designed purely for interactive use and should not be relied upon for any kind of automation? Feels kind of dumb to have to introduce an external dependency (jq) when kubectl natively supports a lot of this filtering.


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issues/16707/1049405576@github.com>

Reply all
Reply to author
Forward
0 new messages