{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/29450","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/29450/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/29450/comments","events_url":"https://api.github.com/repos/docker/docker/issues/29450/events","html_url":"https://github.com/docker/docker/pull/29450","id":195820666,"number":29450,"title":"Fix misleading default for service create/update","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":175374554,"url":"https://api.github.com/repos/docker/docker/labels/status/0-triage","name":"status/0-triage","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-15T14:35:29Z","updated_at":"2016-12-15T22:49:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/29450","html_url":"https://github.com/docker/docker/pull/29450","diff_url":"https://github.com/docker/docker/pull/29450.diff","patch_url":"https://github.com/docker/docker/pull/29450.patch"},"body":"**- What I did**\r\n\r\nThis fix tries to address the issue raised in #29291 where the output of `--replicas`, `--restart-delay`, `--restart-max-attempts`, and `--stop-grace-period` in `service create/update`:\r\n```\r\n      --replicas uint                    Number of tasks (default none)\r\n...\r\n      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h) (default none)\r\n      --restart-max-attempts uint        Maximum number of restarts before giving up (default none)\r\n...\r\n      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h) (default none)\r\n```\r\nare misleading. For example, user might incorrectly assume the number of replicas would be `0` (`none`) by default, while the actual default is `1`.\r\n\r\nThe issue comes from the fact that some of the default values are from daemon and it is not possible for client to find out the default value.\r\n\r\nIn this case, it might be better to just simply not displaying `(default none)`.\r\n\r\n**- How I did it**\r\n\r\nThis fix set a `noDefaultValue bool` in `Uint64Opt` so that it is possible to switch on/off the output of `(default none)` for `Uint64Opt`. This fix also sets `noDefaultValue bool` in `DurationOpt` in a similar fashion.\r\n\r\nNew Output:\r\n```\r\n      --replicas uint                    Number of tasks\r\n...\r\n      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)\r\n      --restart-max-attempts uint        Maximum number of restarts before giving up\r\n...\r\n      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)\r\n```\r\n\r\nThe docs has been updated. Note the docs for help output of `service create/update` is out of sync with the current master. This fix replace with the update to date help output.\r\n\r\n**- How to verify it**\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\n![world-s-cutest-kitten](https://cloud.githubusercontent.com/assets/6932348/21227895/9c863940-c290-11e6-8bb7-73a84013e91f.jpg)\r\n\r\n\r\nThis fix fixes #29291.\r\n\r\nSigned-off-by: Yong Tang <yong.tang.github@outlook.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/267467656","html_url":"https://github.com/docker/docker/pull/29450#issuecomment-267467656","issue_url":"https://api.github.com/repos/docker/docker/issues/29450","id":267467656,"user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T22:49:29Z","updated_at":"2016-12-15T22:49:29Z","body":"I changed the summary so it's not specific to `--replicas` anymore.\r\n\r\nLGTM\r\n\r\nThis also makes the help output a bit easier to read.\r\n\r\nMy only hesitation is that I wonder if we should have `defaultValue bool` instead of `noDefaultValue bool`. But I don't have strong feelings about this."}}
{"actor":{"display_login":"aaronlehmann"}}