Commit Graph

4223 Commits

Author SHA1 Message Date
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
269a50e61f Merge pull request #29198 from allencloud/return-no-swarm-when-unlock-normal-node
return node is not a swarm when unlock a normal node
Upstream-commit: 96f7fedc1e9145f8fd6e8bb2f895fd22e95e6352
Component: engine
2016-12-13 18:59:06 -08:00
2aa298ba4e Fix issues with plugin and --live-restore
Fixes an issue when starting the daemon with live-restore
where previously it was not set, plugins are not running.

Fixes an issue when starting the daemon with live-restore, the plugin
client (for interacting with the plugins HTTP interface) is not set,
causing a panic when the plugin is called.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: cb6633175c0de0a7ae155c4d378cd2379681554b
Component: engine
2016-12-13 16:11:59 -05:00
25c6df8b2c Merge pull request #29349 from vdemeester/try-to-fix-win2lin
Fix failures on Win2lin
Upstream-commit: 39473dad5425d734fdc73df0a678c6edc3d4054b
Component: engine
2016-12-13 08:35:25 -08:00
6ccaba610c Merge pull request #29000 from yongtang/24352-swarm-update-no-flags
Show usage when `docker swarm update` has no flags
Upstream-commit: cda04547c09c418dc0d5f99266757eeeb522f7bd
Component: engine
2016-12-13 16:07:02 +01:00
caf5d45bd8 Merge pull request #29335 from tophj-ibm/skip-plugin-test
[integration-cli] skip plugin tests on non-x86
Upstream-commit: c2b7480604f6692ae0ef8a9b1763cd8e60f12fb5
Component: engine
2016-12-13 14:54:41 +01: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
cc3da24d75 Fixing win2lin builds by adding a testRequires to DockerDaemonSuite
The success of the win2lin CI before was really "by chance" on the
DockerDaemonSuite : the DockerDaemonSuite was panicking when starting
the daemon on the first non-skipped test.The suite panicked but as
the error returned from `StartWithBusybox` was nil, the test kept
going and was OK because the client had all the correct environment
variables set up to discuss with the remote daemon.

Then, as the suite panicked, no more test attached on the
DockerDaemonSuite ran (that's why on win2lin, `DockerDaemonSuite` was
only composed by 5 tests !). The really bad thing is, we didn't get
any report of the panic on the suite (go-check hiding something
somewhere).

As DockerDaemonSuite needs to run test on the same host as it's
running, this adds a `SameHostDaemon` requirement to the Suite.

This changes also make sure `TestRestartContainerWithRestartPolicy`
does left weirdies behind it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e857785df4b53df551ad25d132bc0274923f2e53
Component: engine
2016-12-13 12:04:53 +01:00
0bc3e1033e return not a swarm when unlock
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0270645c13647456834d86082470734e944fdd37
Component: engine
2016-12-13 10:38:45 +08:00
645f8e7ad5 [integration-cli] skip plugin tests on non-x86
Due to the test plugins being architecture specific, these
tests fail to start the plugin (even though they don't fail yet)

Temporary fix until we can build architecture specific test
plugins.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: ebff8c79a3b834c555f92e673c604f14fa0afa33
Component: engine
2016-12-12 17:17:45 -05:00
5cff4675b7 Merge pull request #29074 from yongtang/29044-swarm-ipam-options
Fix missing IPAM options in swarm network mode
Upstream-commit: 3356442d002877eedbf1df9c812ccad2cd0b8294
Component: engine
2016-12-12 17:27:01 +01:00
94e0a7d0c7 Use *check.C in StartWithBusybox, Start, Stop and Restart…
… to make sure it doesn't fail. It also introduce StartWithError,
StopWithError and RestartWithError in case we care about the
error (and want the error to happen).

This removes the need to check for error and make the intent more
clear : I want a deamon with busybox loaded on it — if an error occur
it should fail the test, but it's not the test code that has the
responsability to check that.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c502fb49dc7af89adfb2a9686354aa78c2c46002
Component: engine
2016-12-12 09:46:47 +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
2ce45ea956 Fix missing IPAM options in swarm network mode
This fix tries to fix the issue raised in 29044 where
the IPAM options is missing in swarm network mode
after the service is deployed. Before the service
is deployed, the IPAM options is available.

The reason for the issue is that, before service is
deployed, `network inspect` is querying the swarm and
obtained the correct information.
However, after service is deployed, swarm executor
does not pass the IPAM options to the backend (daemon).
Also after service is deployed, `network inspect` is
actually querying the local daemon for information.
At this time the network information with missing IPAM
options is returned.

This fix fixes the issue by updating the swarm network
allocator and swarm executor.

A separate PR for swarmkit will be opened.

An integration test has been added to cover the change.

This fix fixes 29044.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4d958e99c178f7cd4196ed901c2834ae13f0f7d0
Component: engine
2016-12-10 09:29:50 -08:00
7e5a985603 Remove check.C field from daemon and Use errors package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f4a34a1f065e26bbf1657cf857f02e9bc9a66b47
Component: engine
2016-12-09 22:26:42 +01:00
71651385ac Extract daemon to its own package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 48de91a33f097d4c20515088af1f5bcb9a98c5c9
Component: engine
2016-12-09 22:26:42 +01:00
6b1a2692bb Merge pull request #26398 from tiborvass/plugin-fixes
plugins: container-rootfs-relative paths
Upstream-commit: 0a072e93df6ad10e37bbf0b1f540fff7b7581a75
Component: engine
2016-12-09 12:48:59 -08:00
656f60dc73 plugins: container-rootfs-relative paths
Legacy plugins expect host-relative paths (such as for Volume.Mount).
However, a containerized plugin cannot respond with a host-relative
path. Therefore, this commit modifies new volume plugins' paths in Mount
and List to prepend the container's rootfs path.

This introduces a new PropagatedMount field in the Plugin Config.
When it is set for volume plugins, RootfsPropagation is set to rshared
and the path specified by PropagatedMount is bind-mounted with rshared
prior to launching the container. This is so that the daemon code can
access the paths returned by the plugin from the host mount namespace.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: c54b717caf1a55e525ce180bfcb42addd59c6633
Component: engine
2016-12-09 10:16:24 -08:00
d377a823f5 Merge pull request #29244 from yuexiao-wang/fix-typos-eg
Fix a bit typos
Upstream-commit: d1515a5264e7872bfe11543b2b23b4f1eac23f68
Component: engine
2016-12-09 16:03:35 +09:00
913e79bf2c Merge pull request #29224 from vdemeester/check-no-errors
Use check in params so we don't ignore errors
Upstream-commit: 7ea31b4034a52ffc67067222e24265d19bcff6ba
Component: engine
2016-12-09 00:26:20 +01:00
aacf384e2f Merge pull request #28459 from dmcgowan/plugin-repository-pinning
Plugin repository pinning
Upstream-commit: c1a1b381f91367afa94a69649d9aa808acecc8ac
Component: engine
2016-12-08 11:28:52 -08:00
795fc21c8b Fix a bit typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 11454e1c97ed5495e77a06868a0c199d81aa96c3
Component: engine
2016-12-09 03:05:11 +08:00
53aa37ffde Remove some unused global variables
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 58ad9177d7454893b4b5fca59e4b6b5b9e622308
Component: engine
2016-12-08 19:51:42 +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
1ff39efbfb Merge pull request #29144 from yongtang/29129-hostname-in-host-mode
Fix issue for `--hostname` when running in "--net=host"
Upstream-commit: fee2bb26826ad2be21c66932de12e05a69275970
Component: engine
2016-12-08 12:57:53 +01:00
25481985f3 Use check in params so we don't ignore errors
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: bcad3d5212641237fe97c9ea2668869805e3bce8
Component: engine
2016-12-08 10:56:29 +01:00
b5c8edab7f add break when found in TestVolumeCLICreateWithOpts()
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: feadc5171a9ea5489964b0639135a1bd00e0eb8a
Component: engine
2016-12-08 15:59:52 +08:00
b5155284d2 Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
Upstream-commit: dca76ed50a02659ba7ca4e209356f138ff14dc3e
Component: engine
2016-12-07 17:18:55 -08:00
e048bb17f7 Merge pull request #29139 from ehazlett/fix-api-cors-exec
Add headers when using exec
Upstream-commit: a039ca9affe5fa40c4e029d7aae399b26d433fe9
Component: engine
2016-12-07 17:10:31 -08:00
ce009b27d8 Fix processing of unset build-args during build
This reverts 26103.  26103 was trying to make it so that if someone did:
  docker build --build-arg FOO .
and FOO wasn't set as an env var then it would pick-up FOO from the
Dockerfile's ARG cmd.  However, it went too far and removed the ability
to specify a build arg w/o any value. Meaning it required the --build-arg
param to always be in the form "name=value", and not just "name".

This PR does the right fix - it allows just "name" and it'll grab the value
from the env vars if set. If "name" isn't set in the env then it still needs
to send "name" to the server so that a warning can be printed about an
unused --build-arg. And this is why buildArgs in the options is now a
*string instead of just a string - 'nil' == mentioned but no value.

Closes #29084

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: cdb8ea90b04683adb25c8ccd71b6eaedc44b51e2
Component: engine
2016-12-07 07:41:55 -08:00
ed60722124 not export errors and forbid leave when unlocked
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 7bdd1a4f9c06ab4af8e652b7483104456e72c442
Component: engine
2016-12-07 13:25:34 +08:00
37fb30ac29 Fix docker inspect <unkown object> issue on Windows
This fix tries to address the issue raised on 29185 where
`docker inspect <unknown object>` on Windows will return:
```
Error response from daemon: plugins are not supported on this platform
```

The reason was that in case `--type` is not specified, `docker inspect`
will iterate through different types `container`, `image`, `network`,
`plugin` etc. The `plugin` object is the last type to check.

However, as `plugin` is not supported on Windows yet, the error message
is not very informative for `plugins are not supported on this platform`.

This fix tries to fix the issue by return a `not found` error on unsupported
platforms as well.

An integration test has been added to cover the changes for Windows/Linux.

This fix fixes 29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 88fcdb0a825da040ef2b1f9c191af480f0f2cc90
Component: engine
2016-12-06 12:05:59 -08:00
425efc088a add headers when using exec
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

ensure headers are properly sanitized

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: f86db80b5ff3250a98482b4dc9ff69effbbf2390
Component: engine
2016-12-06 14:27:34 -05:00
d262373ee7 Merge pull request #28907 from tonistiigi/cluster-refactor
Switch cluster locking strategy
Upstream-commit: eefbf1ddd3ee4e6b6e6dc7e938e77a96ceb40163
Component: engine
2016-12-06 10:02:23 -08:00
e76537d57c Fix issue for --hostname when running in "--net=host"
This fix tries to address the issue raised in 29129 where
"--hostname" not working when running in "--net=host" for
`docker run`.

The fix fixes the issue by not resetting the `container.Config.Hostname`
if the `Hostname` has already been assigned through `--hostname`.

An integration test has been added to cover the changes.

This fix fixes 29129.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b0a7b0120f4461daa34527a743087e73ef8f5963
Component: engine
2016-12-06 07:29:45 -08:00
78547424d3 Merge pull request #28823 from AkihiroSuda/ensure-dev-pts-readonly
add a test for ensuring the behavior of read-only /dev/shm
Upstream-commit: 11702c66cfce350ff710d5170921a83b9748d4bf
Component: engine
2016-12-06 08:39:43 -05:00
9603ca0d08 Merge pull request #28896 from yongtang/28884-secret-name-mask-ID
Fix issue where secret ID is masked by name
Upstream-commit: 57d77cc205768624c36b4bd7fb98d9924925087e
Component: engine
2016-12-06 11:05:30 +01:00
92a14fe836 Merge pull request #28535 from yongtang/28497-prune-until
Convert DanglingOnly to Filters for `docker image prune`
Upstream-commit: 745795ef2e0089c5001e5a2fc7ba8c1ab0234857
Component: engine
2016-12-06 11:03:45 +01:00
050e2993f5 Merge pull request #28974 from AkihiroSuda/test-service-logs
improve TestServiceLogs for the goroutine issue #28915
Upstream-commit: 08f0100d5025e32d1392fab3493d5c0436ccdd2c
Component: engine
2016-12-06 10:58:57 +01:00
c6dacdbe65 Merge pull request #29096 from cyli/fix-swarmjoinpromote-test
Fix DockerSwarmSuite.TestSwarmJoinPromoteLocked flakiness
Upstream-commit: 67131bde6d6e5511ce76b0e1dafdbe7293eaa1ab
Component: engine
2016-12-06 10:19:36 +01:00
cc8d5c0801 improve TestServiceLogs for the goroutine issue #28915
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: f8a93d0c9d157dddc4e4d4d9c43a6fe7c7c0c242
Component: engine
2016-12-06 03:44:49 +00:00
cecb5272ed add a test for ensuring the behavior of read-only /dev/shm
The test ensures that `docker run --read-only -v /var/empty:/dev/shm:ro`
makes /dev/shm read-only

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 46ade6acb5b6cdb80287a83afd16c20c6a8b4dff
Component: engine
2016-12-06 03:44:02 +00:00
b729d1ae5d Fix typo in integration-cli (#29160)
Signed-off-by: xianwei <xianwei.zw@alibaba-inc.com>
Upstream-commit: 2dfb57b6706daee8e0855319bc2b121bf970267a
Component: engine
2016-12-05 22:23:41 -05:00
690bfc6638 In DockerSwarmSuite.TestSwarmJoinPromoteLocked, actually wait for the node to
finish being demoted before restarting it and ensuring it isn't locked anymore
to reduce test flakiness.

Signed-off-by: cyli <cyli@twistedmatrix.com>
Upstream-commit: e831a7cdb7a2e60f38e6de8a5e6be4d681181f42
Component: engine
2016-12-05 13:21:27 -08:00
4d3934c3e5 Merge pull request #28967 from yongtang/28946-support-plugin-docker-inspect
Support plugin type in `docker inspect`
Upstream-commit: 24ffa2fa7751e2f1fbdd7e0d5a640f24e8a5b803
Component: engine
2016-12-04 18:30:38 -08:00
085088f73e Fix issue where secret ID is masked by name
This fix tries to address the issue in 28884 where
it is possible to mask the secret ID by name.

The reason was that searching a secret is based on name.
However, searching a secret should be done based on:
- Full ID
- Full Name
- Partial ID (prefix)

This fix addresses the issue by changing related implementation
in `getCliRequestedSecretIDs()`

An integration test has been added to cover the changes.

This fix fixes 28884

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3638ca4d14bcca9bc924f21314e4a1020cd5172f
Component: engine
2016-12-02 20:24:29 -08:00
35037b78fd Convert DanglingOnly to Filters for docker image prune
This fix convert DanglingOnly in ImagesPruneConfig to Filters,
so that it is possible to maintain API compatibility in the future.

Several integration tests have been added to cover changes.

This fix is related to 28497.

A follow up to this PR will be done once this PR is merged.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a6be56b54e871c4e7a6e72881770a64676c27c3c
Component: engine
2016-12-02 20:08:49 -08:00
c0aa09b760 Merge pull request #28988 from vdemeester/28985-dont-validate-hostname
Remove hostname validation as it seems to break users
Upstream-commit: 3cb310c21049f652dd00d20899cb1ece1ee9aa8f
Component: engine
2016-12-02 21:16:56 -05:00
cc93b75a69 Merge pull request #29064 from vdemeester/29005-revert-builder-comments-line
Revert "Fix dockerfile parser with empty line after escape"
Upstream-commit: 6dff86f8b342c92e7686673fece7f31adf1bf836
Component: engine
2016-12-02 17:11:18 -08:00
6be6989ae5 Merge pull request #28994 from cpuguy83/allow_vol_recreate_for_same_driver
Fix out-of-band vol delete+create for same driver
Upstream-commit: 42aafe725ff20c6a97f7e4e06b3ec5ee9e615fb3
Component: engine
2016-12-02 15:12:13 -08:00