DockerCLI/command/service
Yong Tang 23ab849f06 Fix misleading default for `--replicas`
This fix tries to address the issue raised in 29291 where
the output of `--replicas` in `service create/update`:
```
      --replicas uint                    Number of tasks (default none)
```
is misleading. User might incorrectly assume the number of replicas
would be `0` (`none`) by default, while the actual default is `1`.

The 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.

In this case, it might be better to just simply not displaying `(default none)`.

This fix returns "" for `Uint64Opt` so that `(default none)` is hidden.

In addition to `--replicas`, this fix also changes
`--restart-delay`, `--restart-max-attempts`, `--stop-grace-period`,
`--health-interval`, `--health-timeout`, and `--restart-window`
in a similiar fashion.

New Output:
```
      --health-interval duration         Time between running the check (ns|us|ms|s|m|h)
      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h)
...
      --replicas uint                    Number of tasks
...
      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
      --restart-max-attempts uint        Maximum number of restarts before giving up
      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
...
      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
```

The 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.

This fix fixes 29291.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-19 19:35:05 -08:00
..
cmd.go refactor help func in CLI 2016-11-17 10:54:10 -08:00
create.go cli: Pin image to digest using content trust 2016-12-14 10:49:33 -08:00
inspect.go Fix typs from go to Go 2016-10-18 19:40:16 +08:00
inspect_test.go api: Hide UpdateStatus when it is not present 2016-12-01 15:08:41 -08:00
list.go Suppressing digest for docker service ls/ps 2016-11-18 09:39:34 -08:00
logs.go cli: docker service logs support 2016-11-10 13:46:02 -08:00
opts.go Fix misleading default for `--replicas` 2016-12-19 19:35:05 -08:00
opts_test.go Fix misleading default for `--replicas` 2016-12-19 19:35:05 -08:00
parse.go do not force target type for secret references 2016-11-17 15:49:02 -05:00
ps.go Revert "Add -a option to service/node ps" 2016-11-28 18:08:45 +01:00
remove.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
scale.go Return warnings from service create and service update when digest pinning fails 2016-11-18 09:31:31 -08:00
trust.go cli: Pin image to digest using content trust 2016-12-14 10:49:33 -08:00
update.go cli: Pin image to digest using content trust 2016-12-14 10:49:33 -08:00
update_test.go Make --publish-rm precedes --publish-add, so that add wins 2016-12-11 23:14:54 +01:00