Commit Graph

4212 Commits

Author SHA1 Message Date
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
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
34d513c5af Merge pull request #29075 from cpuguy83/29070_fix_tmpfs_opts
Fix issue where TmpfsOptions are not sent to swarm
Upstream-commit: 0fb0d67008157add34f1e11685e23a691db92644
Component: engine
2016-12-02 13:40:20 -08:00
8d0b8ac112 Support plugins in docker inspect
This fix tries to address the proposal raised in 28946
to support plugins in `docker inspect`.

The command `docker inspect` already supports
"container", "image", "node", "network", "service", "volume", "task".
However, `--type plugin` is not supported yet at the moment.

This fix address this issue by adding the support of `--type plugin`
for `docker inspect`.

An additional integration test has been added to cover the changes.

This fix fixes 28946.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 90bb2cdb9f15a9b1b9a4e2ea4242882665daac4e
Component: engine
2016-12-02 11:33:29 -08:00
653a60cf01 Merge pull request #29039 from thaJeztah/fix-restart-limit-validation
Fix restartpolicy max-retry validation
Upstream-commit: 6e023ac7486edf7a2584cb918249b7e5fdaf91d2
Component: engine
2016-12-02 09:19:54 -08:00
1689338c62 Merge pull request #28789 from yongtang/28735-plugin-inspect-id-or-name
Allow `docker plugin inspect` to search based on ID or name
Upstream-commit: 57ace38103e1c9fc13e40c57b0fc77361e389f54
Component: engine
2016-12-02 08:46:47 -08:00
0f9b87c8d5 Fix issue where TmpfsOptions are not sent to swarm
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a5b3649bfaca5958b25e42ab4f2fc5aa30929521
Component: engine
2016-12-02 11:43:47 -05:00
e8c489744e Revert "Fix dockerfile parser with empty line after escape"
This reverts commit 3e1b539e8d0ed4abf695b0a8c42346fba6d5a6b0.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6e0666e622a8b1fc19c19eb490d218eebca15edc
Component: engine
2016-12-02 14:15:55 +01:00
9e849b264c Fix restartpolicy max-retry validation
the restart policy validation was moved from
the client to the daemon in 94e95e4711643640701bd614902e75a2d01f12c5

As part of that change, retry-counts < 1
were marked as "invalid".

However, the default is 0 (unlimited), causing

    docker run -d --restart=on-failure nginx

To fail.

This changes the validation to only invalidate
retry-counts < 0.

A test was added, and other tests renamed
to allow running just these tests :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9db5d649aea1c3d4728d0159bb5175a49f77748e
Component: engine
2016-12-02 02:39:16 +01:00
a68666e468 api: Hide UpdateStatus when it is not present
When UpdateStatus was not present, the empty values of the timestamps
would be present:

        "UpdateStatus": {
            "StartedAt": "0001-01-01T00:00:00Z",
            "CompletedAt": "0001-01-01T00:00:00Z"
        }

To fix this, make the timestamps pointers, so they can be set to nil
when they should not be shown.

Also make UpdateStatus itself a pointer, so an empty object does not
show up when there is no UpdateStatus.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 0e70d96a6813704498a3ce9cc2786648c84daa3a
Component: engine
2016-12-01 15:08:41 -08:00
de12023423 Merge pull request #28997 from cyli/fix-flakey-test
Update the `TestSwarmLockUnlockCluster` test to be less flakey.
Upstream-commit: 0020398c74e8a08dc6b37a946e025324a3c823be
Component: engine
2016-12-01 11:32:30 -08:00
2ac57c6dcf Allow docker plugin inspect to search based on ID or name
This fix tries to address the issue raised in discussion of
PR 28735 where it was not possible to manage plugin based on
plugin ID. Previously it was not possible to invoke
`docker plugin inspect` with a plugin ID (or ID prefix).

This fix updates the implementation of `docker plugin inspect`
so that it is possbile to search based on a plugin name, or a
plugin ID. A short format of plugin ID (prefix) is also possible,
as long as there is no ambiguity.

Previously the check of `docker plugin inspect` was mostly done
on the client side. This could potentially cause inconsistency
between API and CMD. This fix move all the checks to daemon side
so that API and CMD will be consistent.

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0ce6e070f7d1e4b1b478d52b4464f8480dbfd9b7
Component: engine
2016-12-01 10:44:17 -08:00
bcb5d5d669 Switch cluster locking strategy
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b7ea1bdb0227a789a15e23821b8db4d5ddceb26e
Component: engine
2016-11-30 14:59:12 -08:00