{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28695","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28695/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28695/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28695/events","html_url":"https://github.com/kubernetes/kubernetes/issues/28695","id":164577402,"number":28695,"title":"`kubectl run` doesn’t work for simple \"run command, parse result\"","user":{"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},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/usability","name":"area/usability","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/component/kubectl","name":"component/kubectl","color":"0052cc"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/ux","name":"team/ux","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-08T17:24:31Z","updated_at":"2016-07-09T06:35:30Z","closed_at":null,"body":"(source: user feedback)\r\n\r\nFirst, it outputs `Waiting for pod ...` which gets mingled with commands output.  Second, simple output often gets lost.\r\n\r\n**1. -it, date**: doesn't work\r\n```console\r\n$ kubectl run test --rm --restart=Never -it --image=ubuntu -- date\r\nWaiting for pod default/test to be running, status is Pending, pod ready: false\r\nError from server: Unrecognized input header\r\n```\r\n\r\n**2. -it, bash sleep, then date**: works with output mingled with command output \r\n```console\r\n$ kubectl run test --rm --restart=Never -it --image=ubuntu -- bash -c \"sleep 3; date; sleep 3\"\r\nWaiting for pod default/test to be running, status is Pending, pod ready: false\r\n\r\nHit enter for command prompt\r\n                            Fri Jul  8 17:19:50 UTC 2016\r\npod \"test\" deleted\r\n```\r\n\r\n**3. -t, bash sleep, then date**: doesn't work \r\n```console\r\n$ kubectl run test --rm --restart=Never -t --image=ubuntu -- bash -c \"sleep 3; date; sleep 3\"\r\nerror: -i/--stdin is required for containers with -t/--tty=true\r\nSee 'kubectl run -h' for help and examples.\r\n```\r\n\r\n**4. -i, date**: works but output is still mingled \r\n```console\r\n$ kubectl run test --rm --restart=Never -i --image=ubuntu -- date\r\nWaiting for pod default/test to be running, status is Pending, pod ready: false\r\nFri Jul  8 17:21:59 UTC 2016\r\npod \"test\" deleted\r\n```\r\n\r\nCompared to `docker run`, all 4 cases return the same simple output:\r\n```console\r\n$ docker run -i ubuntu date\r\nFri Jul  8 17:23:45 UTC 2016\r\n```\r\n\r\n@kubernetes/kubectl "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/231518840","html_url":"https://github.com/kubernetes/kubernetes/issues/28695#issuecomment-231518840","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28695","id":231518840,"user":{"login":"AdoHe","id":1555564,"avatar_url":"https://avatars.githubusercontent.com/u/1555564?v=3","gravatar_id":"","url":"https://api.github.com/users/AdoHe","html_url":"https://github.com/AdoHe","followers_url":"https://api.github.com/users/AdoHe/followers","following_url":"https://api.github.com/users/AdoHe/following{/other_user}","gists_url":"https://api.github.com/users/AdoHe/gists{/gist_id}","starred_url":"https://api.github.com/users/AdoHe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdoHe/subscriptions","organizations_url":"https://api.github.com/users/AdoHe/orgs","repos_url":"https://api.github.com/users/AdoHe/repos","events_url":"https://api.github.com/users/AdoHe/events{/privacy}","received_events_url":"https://api.github.com/users/AdoHe/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T06:35:30Z","updated_at":"2016-07-09T06:35:30Z","body":"```\r\nWe can add a flag to hide this message\r\n```\r\nI prefer this too."}}
{"actor":{"display_login":"AdoHe"}}