Commit graph

34423 commits

Author SHA1 Message Date
Vincent Demeester
30a8c6c109
Merge pull request #36188 from yongtang/02012018-TestSecretInspect
Migrate TestSecretInspect from integration-cli to api tests
2018-02-06 15:19:08 +01:00
Yong Tang
090c5bf25a
Merge pull request #36192 from yongtang/02012018-docker_cli_nat_test
Migrate some of the nat tests in integration-cli to api tests
2018-02-05 10:54:43 -08:00
Yong Tang
6987557e0c
Merge pull request #36191 from cpuguy83/fix_attachable_network_race
Fix race in attachable network attachment
2018-02-05 09:41:35 -08:00
Vincent Demeester
8745395943
Merge pull request #36202 from AkihiroSuda/remove-wtf
vendor: update BurntSushi/toml for MIT license
2018-02-05 09:21:59 +01:00
Akihiro Suda
6093b917c2 vendor: update BurntSushi/toml for MIT license
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-05 13:57:49 +09:00
Yong Tang
8fb933a30b Migrate some of the nat tests in integration-cli to api tests
This fix migrates nat tests in docker_cli_nat_test.go
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-03 20:18:00 +00:00
Anusha Ragunathan
6e5c2d639f
Merge pull request #36119 from cpuguy83/fix_plugin_scanner
Fix issue with plugin scanner going to deep
2018-02-02 20:19:01 -08:00
Yong Tang
39fe587540
Merge pull request #36193 from dnephin/debug-swagger-gen-failures
Make it easier to debug swagger-gen flakes
2018-02-02 19:54:30 -08:00
Brian Goff
c2b27d5752
Merge pull request #36137 from fcrisciani/libnetwork-vendoring
Libnetwork revendoring
2018-02-02 21:27:27 -05:00
Yong Tang
a5f15c738a
Merge pull request #36190 from dnephin/fix-vendor-check
Fix vendor validation
2018-02-02 16:24:57 -08:00
Yong Tang
1d40e92899 Migrate usage of newSwarm in integration/service to use integration/utils/swarm.NewSwarm
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 23:28:54 +00:00
Flavio Crisciani
ec86547244
Libnetwork revendoring
Diff:
5ab4ab8300...20dd462e0a

- Memberlist revendor (fix for deadlock on exit)
- Network diagnostic client
- Fix for ndots configuration

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-02-02 14:36:32 -08:00
Yong Tang
71c794d912 Migrate TestSecretInspect from integration-cli to api tests
This fix migrates TestSecretInspect from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 22:23:12 +00:00
Brian Goff
b27f70d45a Fix issue with plugin scanner going to deep
The plugin spec says that plugins can live in one of:

- /var/run/docker/plugins/<name>.sock
- /var/run/docker/plugins/<name>/<name>.sock
- /etc/docker/plugins/<name>.[json,spec]
- /etc/docker/plugins/<name>/<name>.<json,spec>
- /usr/lib/docker/plugins/<name>.<json,spec>
- /usr/lib/docker/plugins/<name>/<name>.<json,spec>

However, the plugin scanner which is used by the volume list API was
doing `filepath.Walk`, which will walk the entire tree for each of the
supported paths.
This means that even v2 plugins in
`/var/run/docker/plugins/<id>/<name>.sock` were being detected as a v1
plugin.
When the v1 plugin loader tried to load such a plugin it would log an
error that it couldn't find it because it doesn't match one of the
supported patterns... e.g. when in a subdir, the subdir name must match
the plugin name for the socket.

There is no behavior change as the error is only on the `Scan()` call,
which is passing names to the plugin registry when someone calls the
volume list API.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-02 16:49:14 -05:00
Yong Tang
3a6f8cfd51
Merge pull request #36146 from yongtang/36142-TaskState
Add `REMOVE` and `ORPHANED` to TaskState
2018-02-02 11:33:25 -08:00
Daniel Nephin
d80f25d079 Make it easier to debug swgger-gen flakes
Sometimes this check fails, but git status doesn't give us enough information
to debug the failure.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2018-02-02 11:07:40 -08:00
Yong Tang
deae6a5c08 Remove integration-cli/docker_cli_nat_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 18:59:15 +00:00
Daniel Nephin
075fd7a9be Fix vendor validation
Previously adding files to vendor/ without adding to vendor.conf would not fail the
validation.

Also be consistent with indentation and use tabs.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2018-02-02 10:49:57 -08:00
Brian Goff
c379d2681f Fix race in attachable network attachment
Attachable networks are networks created on the cluster which can then
be attached to by non-swarm containers. These networks are lazily
created on the node that wants to attach to that network.

When no container is currently attached to one of these networks on a
node, and then multiple containers which want that network are started
concurrently, this can cause a race condition in the network attachment
where essentially we try to attach the same network to the node twice.

To easily reproduce this issue you must use a multi-node cluster with a
worker node that has lots of CPUs (I used a 36 CPU node).

Repro steps:

1. On manager, `docker network create -d overlay --attachable test`
2. On worker, `docker create --restart=always --network test busybox
top`, many times... 200 is a good number (but not much more due to
subnet size restrictions)
3. Restart the daemon

When the daemon restarts, it will attempt to start all those containers
simultaneously. Note that you could try to do this yourself over the API,
but it's harder to trigger due to the added latency from going over
the API.

The error produced happens when the daemon tries to start the container
upon allocating the network resources:

```
attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded
```

What happens here is the worker makes a network attachment request to
the manager. This is an async call which in the happy case would cause a
task to be placed on the node, which the worker is waiting for to get
the network configuration.
In the case of this race, the error ocurrs on the manager like this:

```
task allocation failure" error="failed during network allocation for task n7bwwwbymj2o2h9asqkza8gom: failed to allocate network IP for task n7bwwwbymj2o2h9asqkza8gom network rj4szie2zfauqnpgh4eri1yue: could not find an available IP" module=node node.id=u3489c490fx1df8onlyfo1v6e
```

The task is not created and the worker times out waiting for the task.

---

The mitigation for this is to make sure that only one attachment reuest
is in flight for a given network at a time *when the network doesn't
already exist on the node*. If the network already exists on the node
there is no need for synchronization because the network is already
allocated and on the node so there is no need to request it from the
manager.

This basically comes down to a race with `Find(network) ||
Create(network)` without any sort of syncronization.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-02 13:46:23 -05:00
Yong Tang
81e651c6d2
Merge pull request #36177 from yongtang/02012018-docker_api_resize_test
Migrate several resize tests from integration-cli to integration
2018-02-02 10:27:24 -08:00
Yong Tang
8f800c9415 Migrate several resize tests from integration-cli to integration
This fix migrates several resize tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 15:21:47 +00:00
Yong Tang
fd87db3769
Merge pull request #36178 from yongtang/01302018-TestAPIStatsContainerGetMemoryLimit
Migrate TestAPIStatsContainerGetMemoryLimit from integration-cli to api tests
2018-02-01 22:01:05 -08:00
Yong Tang
d5cbde514f Migrate TestAPIStatsContainerGetMemoryLimit from integration-cli to api tests
This fix migrates TestAPIStatsContainerGetMemoryLimit from
integration-cli to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-01 22:07:06 +00:00
Yong Tang
e8d1f35718 Remove integration-cli/docker_api_resize_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-01 16:37:01 +00:00
Tibor Vass
53a58da551
Merge pull request #36160 from kolyshkin/layer-not-retained
daemon.cleanupContainer: nullify container RWLayer upon release
2018-01-31 15:13:00 -08:00
Vincent Demeester
5772c4b8a2
Merge pull request #36166 from yongtang/01312018-TestAPIUpdateContainer
Migrate TestAPIUpdateContainer from integration-cli to api tests
2018-01-31 15:02:00 -08:00
Yong Tang
490edd3582 Migrate TestAPIUpdateContainer from integration-cli to api tests
This fix migrates TestAPIUpdateContainer from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-31 20:02:55 +00:00
Daniel Nephin
231a4408f2
Merge pull request #36150 from yongtang/36139-ContainerStatus
Fix issue of ExitCode and PID not show up in Task.Status.ContainerStatus
2018-01-31 11:59:53 -08:00
Yong Tang
e1f98e8ab3
Merge pull request #36163 from thaJeztah/bump-go-connections
bump docker/go-connections to 98e7d807e5d804e4e42a98d74d1dd695321224ef
2018-01-31 09:20:10 -08:00
Yong Tang
8786b09c81 Remove docker_api_update_unix_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-31 16:10:34 +00:00
Yong Tang
9247e09944 Fix issue of ExitCode and PID not show up in Task.Status.ContainerStatus
This fix tries to address the issue raised in 36139 where
ExitCode and PID does not show up in Task.Status.ContainerStatus

The issue was caused by `json:",omitempty"` in PID and ExitCode
which interprate 0 as null.

This is confusion as ExitCode 0 does have a meaning.

This fix removes  `json:",omitempty"` in ExitCode and PID,
but changes ContainerStatus to pointer so that ContainerStatus
does not show up at all if no content. If ContainerStatus
does have a content, then ExitCode and PID will show up (even if
they are 0).

This fix fixes 36139.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-31 15:35:19 +00:00
Sebastiaan van Stijn
a6d35a822e
bump docker/go-connections to 98e7d807e5d804e4e42a98d74d1dd695321224ef
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-31 01:30:56 -08:00
Akihiro Suda
421664aba1
Merge pull request #36156 from r2d4/move-shell-parser
Move dockerfile ENV shell parser functions into subpackage
2018-01-31 14:48:01 +09:00
Kir Kolyshkin
e9b9e4ace2 daemon.cleanupContainer: nullify container RWLayer upon release
ReleaseRWLayer can and should only be called once (unless it returns
an error), but might be called twice in case of a failure from
`system.EnsureRemoveAll(container.Root)`. This results in the
following error:

> Error response from daemon: driver "XXX" failed to remove root filesystem for YYY: layer not retained

The obvious fix is to set container.RWLayer to nil as soon as
ReleaseRWLayer() succeeds.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-01-30 18:50:59 -08:00
Matt Rickard
a634526d14 Move builder shell parser into subpackage
Moves builder/shell_parser and into its own subpackage at builder/shell since it
has no dependencies other than the standard library. This will make it
much easier to vendor for downstream libraries, without pulling all the
dependencies of builder/.

Fixes #36154

Signed-off-by: Matt Rickard <mrick@google.com>
2018-01-30 17:54:39 -08:00
Sebastiaan van Stijn
a80cd04eb5
Merge pull request #36125 from thaJeztah/fix-plural-singular-node-generic-resources
Fix "--node-generic-resource" singular/plural
2018-01-30 14:38:50 -08:00
Yong Tang
5e7a245c3f
Merge pull request #36148 from yongtang/01302018-TestLinksEtcHostsContentMatch
Migrate some integration-cli test to api tests
2018-01-30 13:38:15 -08:00
Yong Tang
11ccbeb5c5
Merge pull request #36152 from yongtang/01302018-TestAuthAPI
Migrate TestAuthAPI from integration-cli to integration
2018-01-30 13:37:56 -08:00
Yong Tang
d924755789 Migrate TestAuthAPI from integration-cli to integration
This fix migrates TestAuthAPI from integration-cli to integration

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 19:15:06 +00:00
Yong Tang
e6bd20edcb Migrate some integration-cli test to api tests
This fix migrate  TestLinksEtcHostsContentMatch
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 18:52:48 +00:00
Yong Tang
a40687f5ac Add REMOVE and ORPHANED to TaskState
This fix tries to address the issue raised in 36142 where
there are discrepancies between Swarm API and swagger.yaml.

This fix adds two recently added state `REMOVE` and `ORPHANED` to TaskState.

This fix fixes 36142.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 16:46:05 +00:00
Sebastiaan van Stijn
40a9d5d24c
Merge pull request #35946 from joelwurtz/patch-2
Fix Volumes property definition in ContainerConfig
2018-01-29 20:57:09 -08:00
Yong Tang
d98cdc490c
Merge pull request #36141 from yongtang/01292018-stop_test
Migrate docker_cli_stop_test.go to api test
2018-01-29 19:31:01 -08:00
Yong Tang
4f378124ff Migrate docker_cli_stop_test.go to api test
This fix migrate docker_cli_stop_test.go to api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 00:55:18 +00:00
Yong Tang
9d61e5c8c1
Merge pull request #36124 from crosbymichael/exec
Use proc/exe for reexec
2018-01-29 11:41:08 -08:00
Brian Goff
9c5686fbd0
Merge pull request #36131 from yongtang/01282018-swarmkit
Update swarmkit to 68a376dc30d8c4001767c39456b990dbd821371b
2018-01-29 11:07:13 -08:00
Vincent Demeester
d093aa0ec3
Merge pull request #36130 from yongtang/36042-secret-config-mode
Fix secret and config mode issue
2018-01-29 10:37:24 -08:00
Yong Tang
03a1df9536
Merge pull request #36114 from Microsoft/jjh/fixdeadlock-lcowdriver-hotremove
LCOW: Graphdriver fix deadlock in hotRemoveVHDs
2018-01-29 09:57:43 -08:00
Akihiro Suda
cd3c0057ac
Merge pull request #34369 from cyphar/build-buildmode-pie
*: switch to -buildmode=pie
2018-01-29 23:54:03 +09:00
Sebastiaan van Stijn
4219df22fc
Merge pull request #36132 from yongtang/01282018-typo
Fix a typo in CONTRIBUTING.md
2018-01-28 12:21:46 -08:00