Commit Graph

50 Commits

Author SHA1 Message Date
2983ce883c simplify secret lookup on service create
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 6bbc35a743
Component: cli
2016-11-09 14:27:44 -05:00
9c66350efe support the same secret with different targets on service create
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: ab5f829742
Component: cli
2016-11-09 14:27:44 -05:00
41cabcef6d add secret support for service update
- add nosuid and noexec to tmpfs

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 8554b64b99
Component: cli
2016-11-09 14:27:44 -05:00
89698b2350 more review updates
- use /secrets for swarm secret create route
- do not specify omitempty for secret and secret reference
- simplify lookup for secret ids
- do not use pointer for secret grpc conversion

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 4e8f1a7dd9
Component: cli
2016-11-09 14:27:43 -05:00
7158215706 review changes
- fix lint issues
- use errors pkg for wrapping errors
- cleanup on error when setting up secrets mount
- fix erroneous import
- remove unneeded switch for secret reference mode
- return single mount for secrets instead of slice

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 3f9494f1d6
Component: cli
2016-11-09 14:27:43 -05:00
a0307eb205 secrets: secret management for swarm
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use tmpfs for swarm secrets

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: inject secrets from swarm secret store

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: use secret names in cli for service create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

switch to use mounts instead of volumes

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: use ehazlett swarmkit

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: finish secret update

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 1be644fbcf
Component: cli
2016-11-09 14:27:43 -05:00
180746c100 Remove -ptr from the help output of service create
This fix is based on the comment:
https://github.com/docker/docker/pull/28147#discussion_r86996347

Previously the output string of the `DurationOpt` is `duration-ptr`
and `Uint64Opt` is `uint64-ptr`. While it is clear to developers,
for a normal user `-ptr` might not be very informative.

On the other hand, the default value of `DurationOpt` and `Uint64Opt`
has already been quite informative: `none`. That means if no flag
provided, the value will be treated as none.
(like a ptr with nil as the default)

For that reason this fix removes the `-ptr`.

Also, the output in the docs of `service create` has been quite
out-of-sync with the true output. So this fix updates the docs
to have the most up-to-date help output of `service create --help`.

This fix is related to #28147.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 071c746e5e
Component: cli
2016-11-09 06:30:10 -08:00
19b738db2f Fixes #24083 : Improving cli help for flags with duration option
Signed-off-by: milindchawre <milindchawre@gmail.com>
Upstream-commit: e87262cc2d
Component: cli
2016-11-09 12:17:28 +00:00
e7af1d5c1a Merge pull request #27745 from vieux/cli_backward_compose_api
allow client to talk to an older server
Upstream-commit: 7fe223b68b
Component: cli
2016-11-08 18:27:23 -08:00
1c91091ad7 Add custom DNS settings to service update
This fix adds `--dns-add`, `--dns-rm`, `--dns-opt-add`, `--dns-opt-rm`,
`--dns-search-add` and `--dns-search-rm` to `service update`.

An integration test and a unit test have been added to cover the changes in this fix.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 49e528e18a
Component: cli
2016-11-08 15:41:32 -08:00
e9737d7202 Add custom DNS settings to service definition
This fix tries to fix the issue raised in 24391 about allowing
custom DNS settings to service definition.

This fix adds `DNSConfig` (`Nameservers`, `Options`, `Search`) to
service definition, as well as `--dns`, `--dns-opt`, and `dns-search`
to `service create`.

An integration test has been added to cover the changes in this fix.

This fix fixes 24391.

A PR in swarmkit will be created separately.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f40b12d0f7
Component: cli
2016-11-08 15:41:32 -08:00
6e1ba7621a Merge pull request #28147 from yongtang/27567-service-update-docs-plural-form
Change to plural forms for help output of `docker service update`
Upstream-commit: 772dfcbeb1
Component: cli
2016-11-08 11:14:40 -08:00
36d1732f95 Change to plural forms for help output of docker service update
This fix is based on the comment in
https://github.com/docker/docker/pull/27567#discussion_r86910604

Basically, in the help output of `docker service update`, the `--xxx-add`
flags typically have plural forms while `--xxx-rm` flags have singular
forms.

This fix updates the help output for consistency.

This fix also updates the related docs in `service_update.md`.
The help output in `service_update.md` has been quite out-of-sync
with the actual output so this fix replaces the output with the
most up-to-date output.

This fix is related to #27567.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: af8ebf69db
Component: cli
2016-11-08 05:53:56 -08:00
307edac963 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>

update cobra and use Tags

Signed-off-by: Victor Vieux <vieux@docker.com>

allow client to talk to an older server

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 4ae7176ffb
Component: cli
2016-11-08 04:55:27 -08:00
66ece30c85 support show numbers of global service in service ls command
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 7891d349b3
Component: cli
2016-11-08 16:17:15 +08:00
1fe9a67a27 Add --tty to docker service create/update
This fix tries to add `--tty` to `docker service create/update`. As was
specified in 25644, `TTY` flag has been added to SwarmKit and is
already vendored.

This fix add `--tty` to `docker service create/update`.

Related document has been updated.

Additional integration tests has been added.

This fix fixes 25644.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3baa727ed1
Component: cli
2016-11-07 16:42:32 -08:00
d7a0039133 Merge pull request #28029 from tealtail/27994-add-service-ls-truncate-opt
remove COMMAND column from `service ls` output. closes #27994
Upstream-commit: 6780c318a3
Component: cli
2016-11-07 14:39:16 -08:00
00e143bdae Merge pull request #25974 from kunalkushwaha/mount-add
correct handling of volumes while service update.
Upstream-commit: 7a50218855
Component: cli
2016-11-07 10:34:22 -08:00
cd9759a86e Merge pull request #25983 from jhorwit2/jah/ps-refactor
Add -a option to service/node ps
Upstream-commit: dd33c288ec
Component: cli
2016-11-07 17:33:10 +01:00
3c2e5c3d64 remove COMMAND column from service ls output. closes #27994
Signed-off-by: Alicia Lauerman <alicia@eta.im>
Upstream-commit: 1491ae50e0
Component: cli
2016-11-06 13:32:44 -05:00
0ee62b4e2a Add -a option to service/node ps
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
Upstream-commit: 21096cfc05
Component: cli
2016-11-06 07:40:39 -05:00
9739850eeb Add --cpus flag to control cpu resources
This fix tries to address the proposal raised in 27921 and add
`--cpus` flag for `docker run/create`.

Basically, `--cpus` will allow user to specify a number (possibly partial)
about how many CPUs the container will use. For example, on a 2-CPU system
`--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share.

This fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay
have a concept of NanoCPUs for tasks. The `--cpus` flag will translate
the number into reused `NanoCPUs` to be consistent.

This fix adds integration tests to cover the changes.

Related docs (`docker run` and Remote APIs) have been updated.

This fix fixes 27921.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1cab3b32a6
Component: cli
2016-11-04 09:43:10 -07:00
2584223dc2 Merge pull request #27857 from vasil-yordanov/docker-service-hostname-2
Adding the hostname option to docker service command
Upstream-commit: 38a582f54c
Component: cli
2016-11-04 15:22:55 +01:00
3e2986789f correct handling of volumes while service update.
Updating a service to replace a volume is handled properly now.
Fixes bug#25772

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Upstream-commit: b8cf9a880e
Component: cli
2016-11-04 10:15:18 +09:00
2cef813aa2 Adding the hostname option to docker service command
Signed-off-by: Nikolay Milovanov <nmil@itransformers.net>
Upstream-commit: 19b7bc1739
Component: cli
2016-11-03 10:02:14 +00:00
01e1a7306e cli: add --mount to docker run
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 51cb4aa7b8
Component: cli
2016-11-03 07:08:59 +00:00
a513733757 Merge pull request #27979 from allencloud/more-specific-in-service-scale-description
add replicated in service scale command description
Upstream-commit: e279ecacc5
Component: cli
2016-11-02 18:01:59 -07:00
ba2bdb1e37 add replicated in service scale command description
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 39e34ed1a3
Component: cli
2016-11-02 16:15:57 +08:00
ca8b6d0b28 Replace all "Filter" field with "Filters" for consistency
In file `api/types/client.go`, some of the "*Options{}" structs own a
`Filters` field while some else have the name of `Filter`, this commit
will rename all `Filter` to `Filters` for consistency. Also `Filters`
is consistent with API with format `/xxx?filters=xxx`, that's why
`Filters` is the right name.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 9eceaa926f
Component: cli
2016-11-01 23:09:30 +08:00
f65dcbf8f4 Service create --group param
--group-add was used for specifying groups for both service create
and service update. For create it was confusing since we don't have
an existing set of groups. Instead I added --group to create, and
moved --group-add to service update only, like --group-rm
This deals with issue 27646

Signed-off-by: Lily Guo <lily.guo@docker.com>

Update flag documentation

Specify that --group, --group-add and --groupd-rm refers to
supplementary user groups

Signed-off-by: Lily Guo <lily.guo@docker.com>

Fix docs for groups and update completion scripts

Signed-off-by: Lily Guo <lily.guo@docker.com>
Upstream-commit: 378ae7234a
Component: cli
2016-10-28 13:26:31 -07:00
22661cb3e1 Merge pull request #27369 from cezarsa/hc
Add --health-* flags to service create and update
Upstream-commit: 4403644a9e
Component: cli
2016-10-28 21:59:52 +02:00
2d1410ba92 Add --health-* commands to service create and update
A HealthConfig entry was added to the ContainerSpec associated with the
service being created or updated.

Signed-off-by: Cezar Sa Espinola <cezarsa@gmail.com>
Upstream-commit: 87e916a171
Component: cli
2016-10-28 15:19:08 -02:00
af072edbe5 Merge pull request #27654 from gaocegege/add-quiet-mode-to-service-ps
Add -q option to `docker service ps`
Upstream-commit: 4b65bdd802
Component: cli
2016-10-28 05:21:03 +02:00
64087d642d fixes #27643
Signed-off-by: Ce Gao <ce.gao@outlook.com>
Upstream-commit: 4c1560e987
Component: cli
2016-10-28 08:02:57 +08:00
4671c52f80 Merge pull request #26988 from thaJeztah/remove-service-update-name-flag
Remove service update name flag
Upstream-commit: 881831531a
Component: cli
2016-10-27 16:55:47 -07:00
01d713986a Add --env-file flag to docker create service
This fix tries to address the issue in 24712 and add
`--env-file` file to `docker create service`.

Related documentation has been updated.

An additional integration has been added.

This fix fixes 24712.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1250d2afae
Component: cli
2016-10-27 11:48:32 -07:00
9dc55b4321 Remove --name flag from service update
The --name flag was inadvertently added to
docker service update, but is not supported,
as it has various side-effects (e.g., existing
tasks are not renamed).

This removes the flag from the service update
command.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6c80d2bb83
Component: cli
2016-10-27 09:16:29 -07:00
cfa1f345dc Add force option to service update
Currently, there's no way to restart the tasks of a service without
making an actual change to the service. This leads to us giving awkward
workarounds as in
https://github.com/docker/docker.github.io/pull/178/files, where we tell
people to scale a service up and down to restore balance, or make
unnecessary changes to trigger a restart.

This change adds a --force option to "docker service update", which
forces the service to be updated even if no changes require that.

Since rolling update parameters are respected, the user can use
"docker service --force" to do a rolling restart. For example, the
following is supported:

   docker service update --force --update-parallelism 2 \
   --update-delay 5s myservice

Since the default value of --update-parallelism is 1, the default
behavior is to restart the service one task at a time.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: dfed71a6dd
Component: cli
2016-10-21 17:43:27 -07:00
64a984b1c7 Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 06ebd4517d
Component: cli
2016-10-18 10:09:50 -07:00
655c82e562 Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 24d0191a3a
Component: cli
2016-10-18 19:40:16 +08:00
f0fd68b09c Fix broken JSON support in cli/command/formatter
How to test:

    $ docker ps --format '{{json .}}'
    $ docker network ls --format '{{json .}}'
    $ docker volume ls --format '{{json .}}'

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: c11155f0d1
Component: cli
2016-10-17 08:07:17 +00:00
fcc2ad15e7 return nil when no node or service to avoid additional api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6ef1c7deaf
Component: cli
2016-10-11 10:59:16 +08:00
8ba28247b6 Merge pull request #26697 from allencloud/change-service-scale-logic
validate service parameter in client side to avoid api call in `docker service scale`
Upstream-commit: e2870295aa
Component: cli
2016-09-30 18:37:35 +02:00
841efb11eb Fix cli/command/service/opts_test.go, and add some extra test cases
`m.Set("type=volume,target=/foo,volume-nocopy")` is valid even though it lacks "source"

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 2126d8160d
Component: cli
2016-09-27 15:27:02 +00:00
c8795696d6 validate service parameter in client side to avoid api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a16fed83af
Component: cli
2016-09-26 17:18:02 +08:00
22e1ef020d Merge pull request #25025 from cpuguy83/service_inspect_formatter
Add formatter for service inspect
Upstream-commit: 333a0f348f
Component: cli
2016-09-20 14:49:45 +02:00
311b0765b1 Add formatter for service inspect
Allows the user to use `pretty` as the format string.
This enables users to put custom format options into their CLI config
just like is supported for `docker ps` and `docker images`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 20c5a9448d
Component: cli
2016-09-19 16:28:19 -04:00
a765266b0a Only hide commands if the env variable is set.
Better formatting for usage template.
Group commands in usage to management/operation commands.
Remove the word Docker from the description of management commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1f0f7ecb5a
Component: cli
2016-09-19 13:28:15 -04:00
3c8785422e Remove remaining registry methods from DockerCLI.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a26ba0e702
Component: cli
2016-09-09 15:50:01 -04:00
964a552e76 Move api/client -> cli/command
Using
  gomvpkg
     -from github.com/docker/docker/api/client
     -to github.com/docker/docker/cli/command
     -vcs_mv_cmd 'git mv {{.Src}} {{.Dst}}'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3bd1eb4b76
Component: cli
2016-09-08 15:46:29 -04:00