Commit Graph

2245 Commits

Author SHA1 Message Date
1f63571025 tweak logout message
Signed-off-by: Michael Friis <friism@gmail.com>
Upstream-commit: f9443aa2a529553ad0c3227c00980b0e83d457ad
Component: engine
2016-08-12 17:00:06 -07:00
506f438662 Merge pull request #25216 from aanand/deploy-error-when-not-in-swarm-mode
Better error on 'docker deploy' when not in Swarm mode
Upstream-commit: 2a10899c16416ce4802c11ed14db80f803595b24
Component: engine
2016-08-12 14:17:47 -07:00
c6f3cd200c Merge pull request #25070 from yongtang/24881-label-containers-with-stack-name
Label containers with stack name when deploying stack/bundle
Upstream-commit: a86b2376a075b5459b202615667faa6b2980788d
Component: engine
2016-08-12 10:20:06 -07:00
8e29f88e6f Merge pull request #25568 from thaJeztah/enhance-string-truncate
Implement stringutils.Ellipsis()
Upstream-commit: 64f83cee43c6fc0785e2beeacc6432572130714b
Component: engine
2016-08-12 17:19:50 +02:00
720eb363bf Merge pull request #25564 from coolljt0725/fix_inspect_network
Fix inspect network show gateway with mask
Upstream-commit: d8240c8e27b625c6c2b7982e2473cce46e2a9ddc
Component: engine
2016-08-12 11:11:09 +02:00
3ced96b1ad Merge pull request #25557 from yongtang/25529-image-load-api
Return `application/json` for image/load API (quiet=1)
Upstream-commit: 353af0b3ecfe483568fd88754e432c92b0ec088b
Component: engine
2016-08-12 11:07:43 +02:00
42880e91b6 Remove --network-add and --network-rm flags from service update
These flags were not supported (daemon returns an error), and it was an
oversight. They were not present in completion scripts.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 3a7e90c743f6fdccb8aecb9d6d9afd42232fa736
Component: engine
2016-08-11 19:37:21 -07:00
8eacfa50f9 Fix inspect network show gateway with mask
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 096bb5fb0740656b91b3e35f8df23c79270f7f90
Component: engine
2016-08-11 21:08:54 -04:00
a351dde060 Merge pull request #25524 from WeiZhang555/debug-win2lin
Bugfix: client hangs after run container
Upstream-commit: 52286b402ef4c25ac90b35f23a9717680e0f8ff7
Component: engine
2016-08-11 15:43:00 -04:00
fb8424f405 Merge pull request #25428 from yongtang/25375-idempotent-service-update-publish-add
Fix issue in `service update --publish-add`
Upstream-commit: 49cd1680f03f1a388549594373a0717c7fab8b44
Component: engine
2016-08-11 20:11:33 +02:00
b381837a1c Refactor waitExitOrRemoved by mlaventure
Reduce complexity of waitExitOrRemoved.

Signed-off-by: mlaventure
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: eadcb996192e0bded2eaadef842dd86e9013cc27
Component: engine
2016-08-12 00:50:07 +08:00
60e441e430 Implement stringutils.Ellipsis()
This patch implements an Ellipsis utility to
append an ellipsis (...)  when truncating
strings in output.

It also fixes the existing Truncate() utility
to be compatible with unicode/multibyte characters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 51dc35cf23a5418e93128854bedc2e59d8ca743a
Component: engine
2016-08-11 14:14:06 +02:00
adf210319c Merge pull request #25556 from vieux/plugin_description
add description in docker plugin ls
Upstream-commit: ed1a313d8f03ce1cc2eef56e66644fccb4d61eaa
Component: engine
2016-08-11 14:08:50 +02:00
932aa61090 Idempotent service update --publish-add
This fix tries to address the issue raised in 25375 where
`service update --publish-add` returns an error if the exact
same value is repeated (idempotent).

This fix use a map to filter out repeated port configs so
that `--publish-add` does not error out.

An integration test has been added.

This fix fixes 25375.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b487497cd2d7586fd7e10affdcc514ca6b7884f6
Component: engine
2016-08-10 18:03:43 -07:00
f7227f216b add description in docker plugin ls
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 16d5fbfd9aa28d6dab250452b30b51b7916b0888
Component: engine
2016-08-10 13:06:18 -07:00
cb1c855c27 Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
Upstream-commit: 64605d709f9bf5677d513d6ed78d63fffadc697d
Component: engine
2016-08-10 11:07:15 -07:00
77bffbde97 Merge pull request #25427 from yongtang/25404-service-update-env-add
Fix `service update --env-add` issue
Upstream-commit: 59ca493121680212ab119cbf264fcdb75b699adf
Component: engine
2016-08-10 14:07:05 +02:00
6743b7f279 Bugfix: client hangs after run container
New codes introduced a new method to wait container's exit code and
removal via Events API, but it specified a "since" filter based on
client side clock, which sometimes isn't synced up with daemon's clock,
hence leads the client to hang on waiting container's exit status.

This commit brings the Events call before start, and removes the time
filter, so that it can catch daemon events correctly without care of the
clock issue.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: a422813113b3b9a14184766f7f0977ccaaeb661b
Component: engine
2016-08-10 09:36:06 +08:00
139163d715 Return application/json for image/load API (quite=1)
This fix tries to address the issue raised in 25529 wehre the
image/load API returns `application/json` for quiet=0 and
`text/plain` for quite=1.

This fix makes the change so that `application/json` is returned
for both quiet=0 and quite=1.

This fix has been tested manually.

This fix fixes 25529.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 2f27632cde2f0e514bd3a8de77cc1934e5193a83
Component: engine
2016-08-09 17:55:42 -07:00
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
aae342284e Merge pull request #25512 from diogomonica/add-created-at
Adding Joined at to node inspect --pretty
Upstream-commit: 41d580c7a610d8111dc63353cbd94319ca854627
Component: engine
2016-08-09 12:56:32 +02:00
2c79262aba Fix service update --env-add issue
This fix tries to address the issue in 25404 where updating environmental
variable in `service update --env-add` will not work.

The issue is because `--env-add` will only append the env, not update if
the same env already exist.

This fix tracks the env variable with a map and update if the variable
is the same.

An integration test has been added.

This fix fixes 25404.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c6de8add5fd5443aa820adbcd3c9a438df78823f
Component: engine
2016-08-08 19:04:56 -07:00
8c7b924133 Adding Joined at to node inspect
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
Upstream-commit: d1244abc5ce6382b0ebe034bc604ad0c16d2b628
Component: engine
2016-08-08 16:23:10 -07:00
34a323258f Wait container's removal via Events API
If AutoRemove is set, wait until client get `destroy` events, or get
`detach` events that implies container is detached but not stopped.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 6dd8e10d6ed7a7371c5c1824ad58c4403a7b3bfd
Component: engine
2016-08-08 22:46:53 +08:00
b27f1b6d73 Move --rm to daemon side
`--rm` is a client side flag which caused lots of problems:
1. if client lost connection to daemon, including client crash or be
killed, there's no way to clean garbage container.
2. if docker stop a `--rm` container, this container won't be
autoremoved.
3. if docker daemon restart, container is also left over.
4. bug: `docker run --rm busybox fakecmd` will exit without cleanup.

In a word, client side `--rm` flag isn't sufficient for garbage
collection. Move the `--rm` flag to daemon will be more reasonable.

What this commit do is:
1. implement a `--rm` on daemon side, adding one flag `AutoRemove` into
HostConfig.
2. Allow `run --rm -d`, no conflicting `--rm` and `-d` any more,
auto-remove can work on detach mode.
3. `docker restart` a `--rm` container will succeed, the container won't
be autoremoved.

This commit will help a lot for daemon to do garbage collection for
temporary containers.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 3c2886d8a45d8e79b00ab413d91f1af871b58d0a
Component: engine
2016-08-08 22:46:53 +08:00
f1599dae94 Merge pull request #25455 from abronan/improve_cli_promote_demote_output
swarm: improve cli output on node promote/demote for unchanged role
Upstream-commit: 8615c8b52da0a9dfdd51f1e66f76f09d3db5defa
Component: engine
2016-08-06 09:12:46 +02:00
9d14a49a6b swarm: improve cli output on node promote/demote for unchanged role
As of now promoting (or demoting) a node that has its role
left unchanged will always print a successful message.

This PR fixes the issue by matching the behavior on swarmkit's
swarmctl command and printing a message when desired role is
the current role of the node.

As a result this also avoids calling update when it is not
necessary.

Signed-off-by: Alexandre Beslic <alexandre.beslic@gmail.com>
Upstream-commit: 5479df79c7859d5a09f42c22ddb5fa3e56ceeb7c
Component: engine
2016-08-05 15:51:32 -07:00
24a1ece9dc cli: service inspect - Null check for UpdateConfig
Fixes #25453

Signed-off-by: Dave Tucker <dt@docker.com>
Upstream-commit: 0e1fe4516fc7af03259753f6d264e91d11fe4d1a
Component: engine
2016-08-05 22:42:14 +01:00
ed50f67ff9 Merge pull request #24703 from jhorwit2/jah/#24696
Fixes #24696 - Fixes Size showing 0 in formatted ps output
Upstream-commit: 049210ce46f4929257e18e8c33fec6eda5366c10
Component: engine
2016-08-05 21:28:45 +02:00
d006708306 Merge pull request #23475 from vdemeester/add-format-flag-to-network-and-volume-ls
Add format flag to network and volume ls
Upstream-commit: 1ccd9d31372c41aaac5bc9972122348b1007ea14
Component: engine
2016-08-05 15:17:45 +02:00
fb8eea7ff0 Merge pull request #25096 from vieux/docker_plugin_remove_force
Add --force to docker plugin remove
Upstream-commit: 85428a1a53292684be55de9de3646e8c4745c72e
Component: engine
2016-08-05 14:45:05 +02:00
d5f439ee89 Add --force to docker plugin remove
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 0016b331dac94661678fd7676c7b6ccc9ec2d147
Component: engine
2016-08-04 15:55:45 -07:00
652ecddc04 Refactor dockerCli *Format to ConfigFile call
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7c8780ea6327b1d403b13c8b144d9557b5e655e5
Component: engine
2016-08-04 15:00:00 +02:00
b837103bde Add volume --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a488ad1a090eb0b6069f79cd045badaaa8ec1bda
Component: engine
2016-08-04 14:59:55 +02:00
33375755ad Add network --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a8aaafc4a3fc716bdb2c4e571e34c66eb80bbab2
Component: engine
2016-08-04 14:59:51 +02:00
5f35a9dc5e Refactor api/client/formatter files
- Create container.go and image.go for specific context code
- Keep common code in formatter.go and custom.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e4fdbbc00bf90c5d9f87885b0c8ecd7f1d200921
Component: engine
2016-08-04 14:59:45 +02:00
9233ed872e Ignore 'not a swarm error' when inspecting a task.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fab2a3dc826ec05e7fb0dc66748b235fb4a43df6
Component: engine
2016-08-03 12:22:07 -04:00
bfaaeedf5b Convert inspect to cobra.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 851c388ad9aec0547ca7fde24c307b262eaab599
Component: engine
2016-08-03 10:36:47 -04:00
86ea274c7e Mask join tokens in daemon logs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e3917c76ce6f75e6c12cd2099d403fdaba8ab218
Component: engine
2016-08-02 15:15:23 -07:00
4427fb747e Merge pull request #25345 from dperny/fix-service-inspect-pretty
Fix missing newline in service inspect --pretty
Upstream-commit: 404705fd8e5465dd3e314d04c11cb299c195dd52
Component: engine
2016-08-02 17:50:28 -04:00
15ac980cd0 Merge pull request #25159 from diogomonica/adding-force-to-node-remove
Adding force to node rm
Upstream-commit: 10ae908bfa88bf128ce416067391ed125ad0f1be
Component: engine
2016-08-02 22:49:15 +02:00
37e0314e79 Fix missing newline in service inspect --pretty
Printing off networks as part of --pretty was missing a newline, causing
the next thing printed to be concatenated onto the end of the line.
Added an empty println after all networks are printed.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 02ebaf364ff0463c65d63fd1c3c11840a578fc45
Component: engine
2016-08-02 13:27:35 -07:00
d76a57b54d Merge pull request #25308 from thaJeztah/join-token-refactor
Improve swarm join-token instructions
Upstream-commit: 3d28cdd2f5e91e042848321de4cc4dff6735d84d
Component: engine
2016-08-02 18:57:37 +02:00
f03613aded Improve swarm join-token instructions
this change improves the instructions for
swarm join-token and swarm init;

- only print the join-token command for workers
  instead of for both managers and workers, to
  prevent users from copying the wrong command.
  An extra line is added to explain how to obtain
  the manager token.
- print a message that a token was rotated
  sucesfully if '--rotate' is used.
- add some extra white-space before / after
  the join commands, to make copy/pasting
  easier.

this change also does some refactoring of join-token;

- move flagname-constants together with other constants
- use variables for selected role ("worker" / "manager")
  to prevent checking for them multiple times, and to
  keep the "worker" / "manager" sting centralized
- add an extra blank line after "join-token" instructions
  this makes it easier to copy, and cleans up the
  code a tiny bit

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ebebd4176940bc907ba4e8f5fbe62f6a050f8ed4
Component: engine
2016-08-02 16:44:02 +02:00
96d8037700 Update docs in docker service create/update for flag --user
In `docker service create/update`, flag `--user` actually supports
`uid:gid` (same as `docker run`). However, this is not reflected
in the help and documentation yet.

This fix updates docs in `docker service create/update` to change
the description to `Username or UID (format: <name|uid>[:<group|gid>])`.

The help message output has also been updated.

This fix is related to 25304.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 80a3755a8f9eac577b65c3403bcbb23a120e6585
Component: engine
2016-08-02 07:01:16 -07:00
0e5400a423 Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
Upstream-commit: a327c231b5c68c13b7dcde2fdc83b8e4cec59c43
Component: engine
2016-08-01 18:55:58 -07:00
c99b7360ea Merge pull request #25204 from yongtang/25195-docker-info-ca-configuration
Output external CAs in swarm mode with `docker info`
Upstream-commit: 8f78dae4e308e47eb6cdba643c995a8a9b46b0cd
Component: engine
2016-08-01 21:34:00 -04:00
0883d55bb8 Replace "workdir' with const, same as other flags in service create
This is a minor fix that tries to replace `"workdir"` with const in `service create`.

Since `"workdir"` is the only string not defined as const in `func addServiceFlags()`,
I think it makes sense to replace `"workdir"` with a const to be consistent.

The flag `"workdir"` in `service update` has also been replaced.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 55d05fc0556dc7d3ff3c65b8d739e48a1f79afab
Component: engine
2016-08-01 11:45:28 -07:00
a1efc2cd7a Output external CAs in swarm mode with docker info
This fix tries to address the issue raised in 25195 where external
CA configurations are not present in `docker info`.

This fix adds the output of external CAs in `docker info` in swarm
mode.

The test is done manually with:
```
docker run -p 8888:8888 -e CXFSSL_ADDRESS=0.0.0.0 -d fabric8/cfssl
docker swarm init --external-ca protocol=cfssl,url=http://172.17.0.2:8888
```

The `docker info` output:
```
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot interval: 10000
  Heartbeat tick: 1
  Election tick: 3
 Dispatcher:
  Heartbeat period: 5 seconds
 CA configuration:
  Expiry duration: 3 months
  External CAs:
    cfssl: https://172.17.0.2:8888
```

This fix fixes 25195.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 995128e9ebfc1a84bbfe8765d3642f132a4f630d
Component: engine
2016-07-30 09:14:16 -07:00
b87e70e358 update command description in CLI
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6c5988ed8c654527ee8dbae26d5618297f038cef
Component: engine
2016-07-31 00:06:18 +08:00