Commit Graph

535 Commits

Author SHA1 Message Date
e6fc7a5576 Merge pull request #29599 from anusha-ragunathan/refcount
Enforce zero plugin refcount during disable, not remove.
Upstream-commit: d1dfc1a5ef95dc5621a07915f9786199442043c7
Component: engine
2016-12-22 15:38:54 -08:00
9eac558235 Enforce zero plugin refcount during disable.
When plugins have a positive refcount, they were not allowed to be
removed. However, plugins could still be disabled when volumes
referenced it and containers using them were running.

This change fixes that by enforcing plugin refcount during disable.
A "force" disable option is also added to ignore reference refcounting.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 8cb2229cd18c53bdbf36301f26db565a50027d6a
Component: engine
2016-12-22 13:26:53 -08:00
433a6ae35a Merge pull request #29314 from vdemeester/no-more-utils
Remove the utils package
Upstream-commit: b9ee31ae027bbd62477fea3f58023c90f051db00
Component: engine
2016-12-22 15:21:05 +01:00
a961c58e58 Merge pull request #29603 from mstanleyjones/docker_diff_improvements
Clarify what docker diff shows
Upstream-commit: 0ca3e84227a04c0c6256f55b92e9205bd1ca9309
Component: engine
2016-12-22 15:15:01 +01:00
194c3ebac2 Merge pull request #29565 from yuexiao-wang/fix-typo-tls
Change tls to TLS
Upstream-commit: 8f9a48ab5a57b33e99a5231a1ea966cd3910373e
Component: engine
2016-12-22 12:10:09 +01:00
4313743ab7 Merge pull request #29212 from yongtang/29185-docker-inspect
Fix `docker plugin inspect <unkown object>` issue on Windows
Upstream-commit: e91604c0d2d15cacd06e911cab360291a79e5f37
Component: engine
2016-12-21 15:47:17 -05:00
60c04ae8d4 Merge pull request #28714 from thaJeztah/move-logdriver-check-to-daemon
move check for supported drivers to daemon
Upstream-commit: 267d6935c5dcb806d24df8dd78d3d053773f8c19
Component: engine
2016-12-21 13:47:30 -05:00
a72ca85c0c Merge pull request #29491 from yongtang/12162016-stats-error
Improve error output for `docker stats ...`
Upstream-commit: d65d5db2a0351f07060f02c2d2466a12c1cfcd89
Component: engine
2016-12-21 13:19:20 -05:00
97f0ab72fa Merge pull request #29527 from allencloud/change-minor-mistake
change minor mistake of spelling
Upstream-commit: b2e348f2a6ab2d5396acf4bb56aea7e49c3e2097
Component: engine
2016-12-21 13:15:00 -05:00
dd179255a2 Fix docker plugin inspect <unkown object> issue on Windows
This fix is a follow up for comment:
https://github.com/docker/docker/pull/29186/files#r91277345

While #29186 addresses the issue of `docker inspect <unknown object>`
on Windows, it actually makes `docker plugin inspect <unknown object>`
out `object not found` on Windows as well. This is actually misleading
as plugin is not supported on Windows.

This fix reverted the change in #29186 while at the same time,
checks `not supported` in `docker inspect <unknown object>` so that
- `docker plugin inspect <unknown object>` returns `not supported` on Windows
- `docker inspect <unknown object>` returns `not found` on Windows

This fix is related to #29186 and #29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0b3c10ac4ddfe3655bac080440a8553269f2307f
Component: engine
2016-12-20 21:05:10 -08:00
4c53abe848 Clarify what docker diff shows
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 4497801c8a35ca2be9467419c5addff5166442d0
Component: engine
2016-12-20 17:03:11 -08:00
67834a4b9f Merge pull request #29470 from cyli/ask-for-unlock-key-only-if-locked
Check if a swarm is locked before asking a user to enter their unlock key
Upstream-commit: 0d5a715931c514dd9fdc77927105bdf049411b2b
Component: engine
2016-12-20 13:21:47 -08:00
b5e0f7eb0f Change tls to TLS
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 113cae5ba2a0edadadbdf8aea06a52ab6b5f0361
Component: engine
2016-12-20 22:08:07 +08:00
209ed6b4ef change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 7c3657065cc04af278a0f1cee99de8c2401ba0ef
Component: engine
2016-12-20 21:05:19 +08:00
96f73955fb 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>
Upstream-commit: acc93db32bd0d14801db65d6cb0a0e06d7cec2f7
Component: engine
2016-12-19 19:35:05 -08:00
6c8c837c0c Merge pull request #29246 from thaJeztah/improve-swarm-check-in-inspect
Ignore certificate expiry error for top-level inspect
Upstream-commit: 77dde3efa7934959a762781ed42a64c70f49b9c2
Component: engine
2016-12-19 15:37:53 -08:00
ae0f2c64b3 Merge pull request #29339 from dmcgowan/plugins-abstract-download-manager
Abstract layerstore from pull/push distribution code
Upstream-commit: aecb79ff9866ec6b3536c50608706d2d4a6325df
Component: engine
2016-12-19 13:32:28 -08:00
c162add86f Abstract distribution interfaces from image specific types
Move configurations into a single file.
Abstract download manager in pull config.
Add supports for schema2 only and schema2 type checking.
Add interface for providing push layers.
Abstract image store to generically handle configurations.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 3c7676a057a4c0103895f793e407dc6736df139a
Component: engine
2016-12-19 10:55:00 -08:00
e43da16101 remove client-side for supported logging drivers
The `docker logs` command performed a
client-side check if the container's
logging driver was supported.

Now that we allow the client to connect
to both "older" and "newer" daemon versions,
this check is best done daemon-side.

This patch remove the check on the client
side, and leaves validation to the daemon,
which should be the source of truth.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 05dc9846e1266e6a3629c26851acb633a380dd17
Component: engine
2016-12-19 14:30:01 +01:00
1ad841b29e Improve validation for volume specs
The current validation only checked for the
number of elements in the volume-spec, however,
did not validate if the elements were empty.

Because of this, an empty volume-spec (""),
or volume spec only containing separators ("::")
would not be invalidated.

This adds a simple check for empty elements in
the volume-spec, and returns an error if
the spec is invalid.

A unit-test is also added to verify the behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 120241937e67238fd98b839886751bda70129ba8
Component: engine
2016-12-19 01:50:08 +01:00
a9cbc77334 fix conversion of anonymous volumes in compose-file
the `convertVolumeToMount()` function did not take
anonymous volumes into account when converting
volume specifications to bind-mounts.

this resulted in the conversion to try to
look up an empty "source" volume, which
lead to an error;

    undefined volume:

this patch distinguishes "anonymous"
volumes from bind-mounts and named-volumes,
and skips further processing if no source
is defined (i.e. the volume is "anonymous").

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 34889e579f89e389743c35e935709b204bf45bf4
Component: engine
2016-12-18 16:50:32 +01:00
2b846c8a06 Merge pull request #28629 from yongtang/28581-secret-create-input
Add `--file` flag for `docker secret create` command
Upstream-commit: 4436a5946d1cc20efb3af5a3d0c56894c02f1a29
Component: engine
2016-12-18 03:04:10 +01:00
57407d7f5e Improve error output for docker stats ...
While looking into `docker stats <c1> <c2> ...` I noticed that
the error output is quite long, especially if there are multiple errors:
```sh
ubuntu@ubuntu:~/docker$ docker stats nofound
: Error response from daemon: No such container: nofound
ubuntu@ubuntu:~/docker$ docker stats nofound foo bar
: Error response from daemon: No such container: nofound, : Error response from daemon: No such container: foo, : Error response from daemon: No such container: bar
```

There are several issues,
1. There is an extra `: ` at the beginning. That is because if container is not found,
the name will not be available from the daemon.
2. Multiple errors are concatenated with `, ` which will be quite long.

This fix:
1. Only prient out the error from daemon.
2. Multiple errors are printed out line by line.

Below is the new output:
```sh
ubuntu@ubuntu:~/docker$ docker stats nofound
Error response from daemon: No such container: nofound
ubuntu@ubuntu:~/docker$ docker stats nofound foo bar
Error response from daemon: No such container: nofound
Error response from daemon: No such container: foo
Error response from daemon: No such container: bar
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 32de162fc9a18f7f2d702ce488e73b5eca0199ce
Component: engine
2016-12-17 16:51:11 -08:00
8616ae37b9 Merge pull request #29423 from unclejack/api_cli_integ_return
return directly without ifs in remaining packages
Upstream-commit: 21210419447281863f239805ab19248733041a52
Component: engine
2016-12-17 21:30:47 +01:00
d791b713a3 Before asking a user for the unlock key when they run docker swarm unlock, actually
check to see if the node is part of a swarm, and if so, if it is unlocked first.
If neither of these are true, abort the command.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: a6a0880a22e2b135d8a20a46b9ba34c7a9cf2f10
Component: engine
2016-12-16 17:16:55 -08:00
0b16fc446e Merge pull request #29003 from dnephin/pkg-compose-transform
Move composefile -> engine api type conversion to `cli/compose/convert`
Upstream-commit: 914a72541fecfc2e4312015befb7200dd05f4462
Component: engine
2016-12-16 23:34:41 +01:00
c9e434865c Move pkg to cli/compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 643fd775edb0a05d649f4d484e966428eb3a6b09
Component: engine
2016-12-16 12:27:31 -05:00
930d936818 Move ConvertService to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 655e48e65309f0191bbbb8b2e9730b6976e148cd
Component: engine
2016-12-16 12:20:07 -05:00
cb4b458233 Move ConvertVolumes to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7685e80fc9cb79206d81757eee071f0244323600
Component: engine
2016-12-16 11:51:13 -05:00
20aacdd131 Move ConvertNetworks to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6b778c96336fe9c0bcfea477092aab8cdfc0c896
Component: engine
2016-12-16 11:51:13 -05:00
148f65373a swarm leave is not only for workers
the "docker swarm leave" command description
mentioned that the command can only be used
for workers, however, the command can also
be used for managers (using the `-f` / `--force`
option).

this patch removes the "(workers only)" part
of the command description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f89eee5d9d3c01bc6d498fcb1163ec199e6c3078
Component: engine
2016-12-16 15:10:20 +01:00
d363742779 return directly without ifs in remaining packages
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 2c187a24e0003f2f0ab90b85876e668f2b6210d4
Component: engine
2016-12-14 23:28:27 +02:00
8bf34c7522 cli: Pin image to digest using content trust
Implement notary-based digest lookup in the client when
DOCKER_CONTENT_TRUST=1.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: d4d6f8c0d0c6cd0ba6dc96ab7a9ed07e1e766074
Component: engine
2016-12-14 10:49:33 -08:00
87aafbf002 cli: Split out GetNotaryRepository and associated functions
Split these into cli/trust so that other commands can make use of them.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 4b8c79f25ee00ca5dfe22271c166938009bda976
Component: engine
2016-12-14 10:49:32 -08:00
e2664ec347 Merge pull request #28943 from vdemeester/publish-long-short-syntax
Remove --port and update --publish for services to support syntaxes
Upstream-commit: 2fe62f2395b966af7f38e442a91c75d042bb3b65
Component: engine
2016-12-14 17:55:48 +01:00
cc92db8852 Merge pull request #29288 from Microsoft/jjh/promptusestdin
Windows: Prompt fix use regular stdin
Upstream-commit: 5665c7364241e451a507a9e8024b6a8b43675527
Component: engine
2016-12-13 21:18:54 +01:00
e85a4aaddc Ignore certificate expiry error for top-level inspect
The top-level `docker inspect` command could return
an error if the nodes Swarm certificates were expired.

In situations where the user did not explicitly
ask for an object-type (`--type=foo`), we should
ignore these errors, and consider them equal to
"node is not a swarm manager".

This change makes `docker inspect` ignore these
errors if no type was specified.

As a further optimization, the "swarm status"
result is now stored in a variable, so that
other swarm-specific API calls can be skipped.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 66cf4cc7f7942b049e0c99c21b84ab07aa80c777
Component: engine
2016-12-13 17:22:43 +01:00
c3c5d1b1fc Add --file flag for docker secret create command
This fix tries to address the issue raised in 28581 and 28927
where it is not possible to create a secret from a file (only
through STDIN).

This fix add a flag `--file` to `docker secret create` so that
it is possible to create a secret from a file with:
```
docker secret create --file secret.in secret.name
```

or
```
echo TEST | docker secret create --file - secret.name
```

Related docs has been updated.

An integration test has been added to cover the changes.

This fix fixes 28581.
This fix is related to 28927.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c6f0b7f448fac4d037d00f944a7908c60c04dff2
Component: engine
2016-12-13 07:35:45 -08:00
9c84f95c6e Show usage when docker swarm update has no flags
This fix tries to address the issue raised in 24352. Previously,
when `docker swarm update` has no flags, the output is
```
Swarm updated.
```
even though nothing was updated. This could be misleading for
users.

This fix tries to address the issue by adding a `PreRunE` function
in the command so that in case no flag is provided (`cmd.Flags().NFlag() == 0`),
the usage will be outputed instead.

An integration has been added to cover the changes.

This fix fixes 24352.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 5aa5a1cb008963ee6a99011b8f7cd1f489e2bc6a
Component: engine
2016-12-13 05:05:04 -08:00
90bc3ba4b5 Merge pull request #29267 from yuexiao-wang/fix-bulid-para
Update the option for docker build
Upstream-commit: 3d52c86d4c8405372445502b2592e8f63132ce99
Component: engine
2016-12-13 08:55:20 +01:00
d619a55e45 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: cd317282c9b7d4dc68dce8df1d2f84e7a5654e72
Component: engine
2016-12-13 18:18:53 +08:00
93f44feac0 Merge pull request #29196 from aluzzardi/service-ps-output
service ps: Revert output to 1.12 behavior.
Upstream-commit: 91dd29acdcd3e8e1877897e7fc6010005cc9975d
Component: engine
2016-12-12 17:20:45 +01:00
57d5fc9bfa Move templates to pkg/templates
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 04f7a03359ac009ad2cd548fa93124a66e880ae5
Component: engine
2016-12-12 09:34:03 +01:00
38517bb088 Move debug functions to cli/debug package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ce375503477c82a76ce8530e73655fbbf5046834
Component: engine
2016-12-12 09:33:58 +01:00
314935f565 Make --publish-rm precedes --publish-add, so that add wins
`--publish-add 8081:81 --publish-add 8082:82 --publish-rm 80
--publish-rm 81/tcp --publish-rm 82/tcp` would thus result in 81 and
82 to be published.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9d4aa3621f226f4167fb7c3585dfe1c37c40472e
Component: engine
2016-12-11 23:14:54 +01:00
97f2808afa Remove --port and update --publish for services to support syntaxes
Add support for simple and complex syntax to `--publish` through the
use of `PortOpt`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 75bf18c9f01d050e5fccab98fb671306c7c5f6d2
Component: engine
2016-12-11 23:14:54 +01:00
a586c34f99 Windows: Prompt fix
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 30b8f084436a2a1d5e8523fcd2c5ea64cc805224
Component: engine
2016-12-09 14:27:53 -08:00
fede611756 Merge pull request #25860 from yongtang/1396-service-update-publish-rm
Return error for incorrect argument of `service update --publish-rm`
Upstream-commit: 032b5b21b603282e613b6d98da1c7cc2b021a924
Component: engine
2016-12-08 20:09:56 +01:00
6e67e38b7d Merge pull request #29020 from wefine/commands_order
Give a order to AddCommands, for better read and maintenance.
Upstream-commit: cefda34773e6fbf68f43135f25c00d756bb8cd1a
Component: engine
2016-12-08 15:13:22 +01:00
3185ae49df Merge pull request #29041 from aaronlehmann/hide-updatestatus
api: Hide UpdateStatus when it is not present
Upstream-commit: e94a40cddaca7b920405a730d29892e49f1be19b
Component: engine
2016-12-08 13:55:13 +01:00