{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/30621","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/30621/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/30621/comments","events_url":"https://api.github.com/repos/docker/docker/issues/30621/events","html_url":"https://github.com/docker/docker/pull/30621","id":204499694,"number":30621,"title":"Fix issues when there are spaces in `--format \" table \"` or `--format \" raw \"`","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"labels":[{"id":175375318,"url":"https://api.github.com/repos/docker/docker/labels/status/1-design-review","name":"status/1-design-review","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-01T05:17:43Z","updated_at":"2017-02-08T02:23:27Z","closed_at":"2017-02-08T02:23:27Z","pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/30621","html_url":"https://github.com/docker/docker/pull/30621","diff_url":"https://github.com/docker/docker/pull/30621.diff","patch_url":"https://github.com/docker/docker/pull/30621.patch"},"body":"**- What I did**\r\nThis fix tries to address the issue where spaces combined with `\"table\"` or `\"raw\"` in `--format` caused incorrect rendering. For example, `--format \"    table   \"` for `--format \"     raw\"  `\r\n\r\nThe following are examples:\r\n```\r\nubuntu@ubuntu:~/docker$ docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES\r\nf183787c2d35        busybox             \"top\"               About an hour ago   Up About an hour                        kind_wozniak\r\nubuntu@ubuntu:~/docker$ docker ps --format ' table '\r\ntable\r\nubuntu@ubuntu:~/docker$ docker ps --format ' table {{.ID}} {{.Image}}'\r\ntable f183787c2d35 busybox\r\nubuntu@ubuntu:~/docker$ docker ps --format ' raw  '\r\nraw\r\nubuntu@ubuntu:~/docker$\r\n```\r\n\r\nThe reason with the above incorrect rendering is that, `table` or `raw` format checking was not compared after space trimmed.\r\n\r\nAnd `IsTable()` does not take into consideration the spaces as well.\r\n\r\n**- How I did it**\r\n\r\nThis fix fixes the issue.\r\n\r\n**- How to verify it**\r\n\r\nAdditional test cases have been added to cover the changes\r\n\r\n**- Description for the changelog**\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\nSigned-off-by: Yong Tang <yong.tang.github@outlook.com>\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/278210035","html_url":"https://github.com/docker/docker/pull/30621#issuecomment-278210035","issue_url":"https://api.github.com/repos/docker/docker/issues/30621","id":278210035,"user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"created_at":"2017-02-08T02:23:27Z","updated_at":"2017-02-08T02:23:27Z","body":"@cpuguy83 Thanks for the feedback. I am not so sure as well. Was running into an issue when a prefix'ed space caused formatting issue, think it may worth to take a look.\r\n\r\nLet me close this PR for now."}}
{"actor":{"display_login":"yongtang"}}