DockerCLI/cli/command/service
Sebastiaan van Stijn 0c27355f7b
Use non-detached mode as default for service commands
Commit 330a0035334871d92207b583c1c36d52a244753f added a `--detach=false` option
to various service-related commands, with the intent to make this the default in
a future version (17.09).

This patch changes the default to use "interactive" (non-detached), allowing
users to override this by setting the `--detach` option.

To prevent problems when connecting to older daemon versions (17.05 and below,
see commit db60f25561), the detach option is
ignored for those versions, and detach is always true.

Before this change, a warning was printed to announce the upcoming default:

    $ docker service create nginx:alpine
    saxiyn3pe559d753730zr0xer
    Since --detach=false was not specified, tasks will be created in the background.
    In a future release, --detach=false will become the default.

After this change, no warning is printed, but `--detach` is disabled;

    $ docker service create nginx:alpine
    y9jujwzozi0hwgj5yaadzliq6
    overall progress: 1 out of 1 tasks
    1/1: running   [==================================================>]
    verify: Service converged

Setting the `--detach` flag makes the cli use the pre-17.06 behavior:

    $ docker service create --detach nginx:alpine
    280hjnzy0wzje5o56gr22a46n

Running against a 17.03 daemon, without specifying the `--detach` flag;

    $ docker service create nginx:alpine
    kqheg7ogj0kszoa34g4p73i8q

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-13 12:27:55 +02:00
..
progress Merge pull request #259 from aaronlehmann/service-progress-surface-error 2017-07-09 00:04:38 -07:00
testdata Sort services names in a natural order 2017-07-19 18:18:06 +03:00
client_test.go Reduce complexity in cli/command/container 2017-08-29 19:25:50 -04:00
cmd.go Add 'docker service rollback' subcommand 2017-08-16 22:18:36 +02:00
create.go Use non-detached mode as default for service commands 2017-09-13 12:27:55 +02:00
helpers.go Use non-detached mode as default for service commands 2017-09-13 12:27:55 +02:00
inspect.go Add 'docker service rollback' subcommand 2017-08-16 22:18:36 +02:00
inspect_test.go updated vendoring 2017-09-01 19:41:06 -04:00
list.go Sort services names in a natural order 2017-07-19 18:18:06 +03:00
list_test.go Move internal/test package out of cli. 2017-08-22 10:14:25 -04:00
logs.go Use a local copy of ParseLogDetails 2017-09-07 12:50:25 -04:00
opts.go Use non-detached mode as default for service commands 2017-09-13 12:27:55 +02:00
opts_test.go Move duration opts into an opts package 2017-05-16 17:49:40 +02:00
parse.go Handle case of configs on old daemon 2017-06-07 17:02:46 +02:00
ps.go Reduce complexity in cli/command/container 2017-08-29 19:25:50 -04:00
ps_test.go Reduce complexity in cli/command/container 2017-08-29 19:25:50 -04:00
remove.go Add 'docker service rollback' subcommand 2017-08-16 22:18:36 +02:00
rollback.go Use non-detached mode as default for service commands 2017-09-13 12:27:55 +02:00
rollback_test.go Use new internal testutil.ErrorContains() 2017-08-22 10:14:25 -04:00
scale.go Use non-detached mode as default for service commands 2017-09-13 12:27:55 +02:00
trust.go updated vendoring 2017-09-01 19:41:06 -04:00
update.go Use non-detached mode as default for service commands 2017-09-13 12:27:55 +02:00
update_test.go updated vendoring 2017-09-01 19:41:06 -04:00