{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/12015","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/12015/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/12015/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/12015/events","html_url":"https://github.com/openshift/origin/pull/12015","id":191363810,"number":12015,"title":"UPSTREAM: 38112: Add json,yaml output format support to `oc create`, `oc apply`","user":{"login":"juanvallejo","id":3902875,"avatar_url":"https://avatars.githubusercontent.com/u/3902875?v=3","gravatar_id":"","url":"https://api.github.com/users/juanvallejo","html_url":"https://github.com/juanvallejo","followers_url":"https://api.github.com/users/juanvallejo/followers","following_url":"https://api.github.com/users/juanvallejo/following{/other_user}","gists_url":"https://api.github.com/users/juanvallejo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanvallejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanvallejo/subscriptions","organizations_url":"https://api.github.com/users/juanvallejo/orgs","repos_url":"https://api.github.com/users/juanvallejo/repos","events_url":"https://api.github.com/users/juanvallejo/events{/privacy}","received_events_url":"https://api.github.com/users/juanvallejo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-23T19:41:54Z","updated_at":"2016-12-06T01:21:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/12015","html_url":"https://github.com/openshift/origin/pull/12015","diff_url":"https://github.com/openshift/origin/pull/12015.diff","patch_url":"https://github.com/openshift/origin/pull/12015.patch"},"body":"Upstream: https://github.com/kubernetes/kubernetes/pull/38112\r\nRelated upstream issue: https://github.com/kubernetes/kubernetes/issues/37390\r\n\r\nThis patch adds the ability to specify an output format other than\r\n\"name\" to `oc create ...`. It can be used in conjunction with the\r\n`--dry-run` option.\r\n\r\nWill add upstream PR\r\n\r\nDue to the `mapper` being an [UnstructuredObject](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/create.go#L114), using a `wide` format option results in the error:\r\n```\r\nerror: unknown type &runtime.Unstructured{Object:map[string]interface {}{\"status\":map[string]interface {}{\"lastVersion\":1}, \"kind\":\"BuildConfig\", \"apiVersion\":\"v1\", \"metadata\":map[string]interface {}{\"name\":\"gitauthtest\", \"namespace\":\"default\", \"selfLink\":\"/oapi/v1/namespaces/default/buildconfigs/gitauthtest\", \"uid\":\"39b2c5a1-b1b3-11e6-9a01-507b9dac96e1\", \"resourceVersion\":\"800167\", \"creationTimestamp\":\"2016-11-23T19:30:00Z\", \"labels\":map[string]interface {}{\"app\":\"gitauthtest\", \"template\":\"gitserver\"}, \"annotations\":map[string]interface {}{\"openshift.io/generated-by\":\"OpenShiftNewApp\"}}, \"spec\":map[string]interface {}{\"runPolicy\":\"Serial\", \"source\":map[string]interface {}{\"type\":\"Git\", \"git\":map[string]interface {}{\"uri\":\"http://gitserver-tokenauth.linux.xip.io/ruby-hello-world\"}, \"sourceSecret\":map[string]interface {}{\"name\":\"builder-token-nbme5\"}}, \"strategy\":map[string]interface {}{\"type\":\"Source\", \"sourceStrategy\":map[string]interface {}{\"from\":map[string]interface {}{\"kind\":\"ImageStreamTag\", \"namespace\":\"openshift\", \"name\":\"ruby:latest\"}}}, \"output\":map[string]interface {}{}, \"resources\":map[string]interface {}{}, \"postCommit\":map[string]interface {}{}, \"nodeSelector\":interface {}(nil), \"triggers\":[]interface {}{}}}}\r\n```\r\n\r\nTo mitigate this, an `unsupported output format` error message is printed when a format like this one is specified.\r\n\r\n**Example**\r\n```\r\n$ oc create -f pkg/api/graph/test/bc-missing-output.yaml --dry-run -o yaml\r\napiVersion: v1\r\nkind: BuildConfig\r\nmetadata:\r\n  annotations:\r\n    openshift.io/generated-by: OpenShiftNewApp\r\n  creationTimestamp: 2015-11-18T14:41:17Z\r\n  labels:\r\n    app: gitauthtest\r\n    template: gitserver\r\n  name: gitauthtest\r\n  namespace: default\r\nspec:\r\n  output: {}\r\n  resources: {}\r\n  source:\r\n    git:\r\n      uri: http://gitserver-tokenauth.linux.xip.io/ruby-hello-world\r\n    sourceSecret:\r\n      name: builder-token-nbme5\r\n    type: Git\r\n  strategy:\r\n    sourceStrategy:\r\n      from:\r\n        kind: ImageStreamTag\r\n        name: ruby:latest\r\n        namespace: openshift\r\n    type: Source\r\n  triggers: []\r\nstatus:\r\n  lastVersion: 1\r\n```\r\n\r\n```\r\n$ oc create -f pkg/api/graph/test/bc-missing-output.yaml --dry-run -o wide\r\nerror: That output format is not supoported\r\n```\r\n\r\ncc @openshift/cli-review "},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/265032235","html_url":"https://github.com/openshift/origin/pull/12015#issuecomment-265032235","issue_url":"https://api.github.com/repos/openshift/origin/issues/12015","id":265032235,"user":{"login":"openshift-bot","id":1779249,"avatar_url":"https://avatars.githubusercontent.com/u/1779249?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift-bot","html_url":"https://github.com/openshift-bot","followers_url":"https://api.github.com/users/openshift-bot/followers","following_url":"https://api.github.com/users/openshift-bot/following{/other_user}","gists_url":"https://api.github.com/users/openshift-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift-bot/subscriptions","organizations_url":"https://api.github.com/users/openshift-bot/orgs","repos_url":"https://api.github.com/users/openshift-bot/repos","events_url":"https://api.github.com/users/openshift-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openshift-bot/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T01:21:29Z","updated_at":"2016-12-06T01:21:29Z","body":"continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12035/) (Base Commit: ec0d94cc87ff6bbba3ec8b8653f616971839f561)"}}
{"actor":{"display_login":"openshift-bot"}}