{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33890","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33890/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33890/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33890/events","html_url":"https://github.com/kubernetes/kubernetes/pull/33890","id":180508888,"number":33890,"title":"JSONPath output shoud be JSON","user":{"login":"mikkeloscar","id":128566,"avatar_url":"https://avatars.githubusercontent.com/u/128566?v=3","gravatar_id":"","url":"https://api.github.com/users/mikkeloscar","html_url":"https://github.com/mikkeloscar","followers_url":"https://api.github.com/users/mikkeloscar/followers","following_url":"https://api.github.com/users/mikkeloscar/following{/other_user}","gists_url":"https://api.github.com/users/mikkeloscar/gists{/gist_id}","starred_url":"https://api.github.com/users/mikkeloscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikkeloscar/subscriptions","organizations_url":"https://api.github.com/users/mikkeloscar/orgs","repos_url":"https://api.github.com/users/mikkeloscar/repos","events_url":"https://api.github.com/users/mikkeloscar/events{/privacy}","received_events_url":"https://api.github.com/users/mikkeloscar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20no","name":"cla: no","color":"e11d21"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-label-needed","name":"release-note-label-needed","color":"db5a64"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/L","name":"size/L","color":"ee9900"}],"state":"open","locked":false,"assignee":{"login":"fabianofranz","id":158611,"avatar_url":"https://avatars.githubusercontent.com/u/158611?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianofranz","html_url":"https://github.com/fabianofranz","followers_url":"https://api.github.com/users/fabianofranz/followers","following_url":"https://api.github.com/users/fabianofranz/following{/other_user}","gists_url":"https://api.github.com/users/fabianofranz/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianofranz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianofranz/subscriptions","organizations_url":"https://api.github.com/users/fabianofranz/orgs","repos_url":"https://api.github.com/users/fabianofranz/repos","events_url":"https://api.github.com/users/fabianofranz/events{/privacy}","received_events_url":"https://api.github.com/users/fabianofranz/received_events","type":"User","site_admin":false},"assignees":[{"login":"fabianofranz","id":158611,"avatar_url":"https://avatars.githubusercontent.com/u/158611?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianofranz","html_url":"https://github.com/fabianofranz","followers_url":"https://api.github.com/users/fabianofranz/followers","following_url":"https://api.github.com/users/fabianofranz/following{/other_user}","gists_url":"https://api.github.com/users/fabianofranz/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianofranz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianofranz/subscriptions","organizations_url":"https://api.github.com/users/fabianofranz/orgs","repos_url":"https://api.github.com/users/fabianofranz/repos","events_url":"https://api.github.com/users/fabianofranz/events{/privacy}","received_events_url":"https://api.github.com/users/fabianofranz/received_events","type":"User","site_admin":false},{"login":"janetkuo","id":4876867,"avatar_url":"https://avatars.githubusercontent.com/u/4876867?v=3","gravatar_id":"","url":"https://api.github.com/users/janetkuo","html_url":"https://github.com/janetkuo","followers_url":"https://api.github.com/users/janetkuo/followers","following_url":"https://api.github.com/users/janetkuo/following{/other_user}","gists_url":"https://api.github.com/users/janetkuo/gists{/gist_id}","starred_url":"https://api.github.com/users/janetkuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janetkuo/subscriptions","organizations_url":"https://api.github.com/users/janetkuo/orgs","repos_url":"https://api.github.com/users/janetkuo/repos","events_url":"https://api.github.com/users/janetkuo/events{/privacy}","received_events_url":"https://api.github.com/users/janetkuo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":12,"created_at":"2016-10-02T11:57:43Z","updated_at":"2016-10-07T19:07:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/33890","html_url":"https://github.com/kubernetes/kubernetes/pull/33890","diff_url":"https://github.com/kubernetes/kubernetes/pull/33890.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/33890.patch"},"body":"Makes `-o jsonpath` return json formatted output instead of literal go structs.\r\n\r\n#### Example:\r\nBefore:\r\n```sh\r\n$ kubectl --namespace kube-system get pod -o jsonpath='{.items[*].metadata}'\r\nmap[creationTimestamp:2016-10-02T13:07:19Z annotations:map[kubernetes.io/config.seen:2016-10-02T13:07:14.694668345Z kubernetes.io/config.source:file kubernetes.io/config.hash:48abed82af93bb0b941173334110923f kubernetes.io/config.mirror:48abed82af93bb0b941173334110923f] name:kube-addon-manager-minikube namespace:kube-system selfLink:/api/v1/namespaces/kube-system/pods/kube-addon-manager-minikube uid:266b0755-88a1-11e6-ad3e-86d54c81ce22 resourceVersion:3430] map[labels:map[app:kubernetes-dashboard kubernetes.io/cluster-service:true version:v1.4.0] annotations:map[kubernetes.io/created-by:{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicationController\",\"namespace\":\"kube-system\",\"name\":\"kubernetes-dashboard\",\"uid\":\"545b26e8-88b3-11e6-95ec-8692d7cab6f2\",\"apiVersion\":\"v1\",\"resourceVersion\":\"63\"}}\r\n] name:kubernetes-dashboard-rw7nt resourceVersion:3428 selfLink:/api/v1/namespaces/kube-system/pods/kubernetes-dashboard-rw7nt uid:545bcb51-88b3-11e6-95ec-8692d7cab6f2 creationTimestamp:2016-10-02T15:17:27Z generateName:kubernetes-dashboard- namespace:kube-system]\r\n```\r\n\r\nAfter:\r\n```sh\r\n$ kubectl --namespace kube-system get pod -o jsonpath='{.items[*].metadata}'     \r\n[\r\n    {\r\n        \"annotations\": {\r\n            \"kubernetes.io/config.hash\": \"48abed82af93bb0b941173334110923f\",\r\n            \"kubernetes.io/config.mirror\": \"48abed82af93bb0b941173334110923f\",\r\n            \"kubernetes.io/config.seen\": \"2016-10-02T13:07:14.694668345Z\",\r\n            \"kubernetes.io/config.source\": \"file\"\r\n        },\r\n        \"creationTimestamp\": \"2016-10-02T13:07:19Z\",\r\n        \"name\": \"kube-addon-manager-minikube\",\r\n        \"namespace\": \"kube-system\",\r\n        \"resourceVersion\": \"3430\",\r\n        \"selfLink\": \"/api/v1/namespaces/kube-system/pods/kube-addon-manager-minikube\",\r\n        \"uid\": \"266b0755-88a1-11e6-ad3e-86d54c81ce22\"\r\n    },\r\n    {\r\n        \"annotations\": {\r\n            \"kubernetes.io/created-by\": \"{\\\"kind\\\":\\\"SerializedReference\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"reference\\\":{\\\"kind\\\":\\\"ReplicationController\\\",\\\"namespace\\\":\\\"kube-system\\\",\\\"name\\\":\\\"kubernetes-dashboard\\\",\\\"uid\\\":\\\"545b26e8-88b3-11e6-95ec-8692d7cab6f2\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"resourceVersion\\\":\\\"63\\\"}}\\n\"\r\n        },\r\n        \"creationTimestamp\": \"2016-10-02T15:17:27Z\",\r\n        \"generateName\": \"kubernetes-dashboard-\",\r\n        \"labels\": {\r\n            \"app\": \"kubernetes-dashboard\",\r\n            \"kubernetes.io/cluster-service\": \"true\",\r\n            \"version\": \"v1.4.0\"\r\n        },\r\n        \"name\": \"kubernetes-dashboard-rw7nt\",\r\n        \"namespace\": \"kube-system\",\r\n        \"resourceVersion\": \"3428\",\r\n        \"selfLink\": \"/api/v1/namespaces/kube-system/pods/kubernetes-dashboard-rw7nt\",\r\n        \"uid\": \"545bcb51-88b3-11e6-95ec-8692d7cab6f2\"\r\n    }\r\n]\r\n```\r\n\r\n#### More simple example:\r\n\r\nBefore:\r\n```sh\r\n$ kubectl --namespace kube-system get pod -o jsonpath='{.items[*].metadata.name}' \r\nkube-addon-manager-minikube kubernetes-dashboard-rw7nt\r\n```\r\n\r\nAfter:\r\n```sh\r\n$ kubectl --namespace kube-system get pod -o jsonpath='{.items[*].metadata.name}'\r\n[\r\n    \"kube-addon-manager-minikube\",\r\n    \"kubernetes-dashboard-rw7nt\"\r\n]\r\n```\r\n\r\nThis is largely based on a previous PR (#26099) by @dims. I have just fixed the tests and are prepared to work on any issues there might be to get this merged.\r\n\r\nFixes #16707\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/33890)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/252335913","html_url":"https://github.com/kubernetes/kubernetes/pull/33890#issuecomment-252335913","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/33890","id":252335913,"user":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T19:07:34Z","updated_at":"2016-10-07T19:07:34Z","body":"@fabianofranz A pretty-printed JSON list of JSON maps for complex fields requested via jsonpath makes sense to me. Whatever we output currently seems pretty unreadable and unusable for scripting. "}}
{"actor":{"display_login":"bgrant0607"}}