{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/30180","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/30180/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/30180/comments","events_url":"https://api.github.com/repos/docker/docker/issues/30180/events","html_url":"https://github.com/docker/docker/pull/30180","id":200965145,"number":30180,"title":"add endpoint mode a default value","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/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":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-16T09:15:37Z","updated_at":"2017-01-16T09:28:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/30180","html_url":"https://github.com/docker/docker/pull/30180","diff_url":"https://github.com/docker/docker/pull/30180.diff","patch_url":"https://github.com/docker/docker/pull/30180.patch"},"body":"Signed-off-by: allencloud <allen.sun@daocloud.io>\r\n\r\nWhen I create a service without specifying the endpoint mode for it, I found that this service's endpoint mode is vip. So I think maybe we should add this default value in the `docker service create --help`.\r\n\r\nIn addition, I found that when I typed a wrong endpoint mode like `DNSRsR` or `vipp`, the error message will be from docker daemon, I think client validation error will be better.\r\n```\r\nroot@ubuntu:~# docker service create --endpoint-mode DNSRsR alpine sleep 110000\r\nError response from daemon: invalid resolution mode: \"dnsrsr\"\r\n```\r\n\r\n**- What I did**\r\n1. add a default value in `docker service create --help`\r\n2. make endpoint mode validation in client side and more strict, make Uppercase invalid;\r\n3. make error message more readable, using `\"Unknown endpoint mode: %s, only vip and dnsrr supported\"` and `\"Unknown mode: %s, only replicated and global supported\"`.\r\n\r\n**- How I did it**\r\n\r\n**- How to verify it**\r\n\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\n\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/272811696","html_url":"https://github.com/docker/docker/pull/30180#issuecomment-272811696","issue_url":"https://api.github.com/repos/docker/docker/issues/30180","id":272811696,"user":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"created_at":"2017-01-16T09:28:11Z","updated_at":"2017-01-16T09:28:11Z","body":"/cc @thaJeztah @mavenugo @aboch @aaronlehmann "}}
{"actor":{"display_login":"vdemeester"}}