Commit graph

34480 commits

Author SHA1 Message Date
Vincent Demeester
812592d911
Merge pull request #36249 from cpuguy83/36145_fix_container_reload
Fix container cleanup on daemon restart
2018-02-12 11:36:18 +01:00
Yong Tang
5f9570c7ac
Merge pull request #36273 from yongtang/02092018-pause_test
Migrate container pause tests to api tests
2018-02-12 02:32:52 -08:00
Sebastiaan van Stijn
84bde485d7
Merge pull request #36275 from liubin/fix-daemon
Fix typos in daemon directory
2018-02-12 09:18:01 +01:00
Yong Tang
ea2f076ca9 Migrate container pause tests to api tests
This fix migrates container pause tests from integration-cli
to api tests in integration/.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-12 01:24:43 +00:00
Akihiro Suda
178ebca0b9
Merge pull request #36257 from arm64b/fix-inspect-network-timeout
Fix timeout issue of `InspectNetwork` on AArch64
2018-02-11 20:50:08 +09:00
Akihiro Suda
52a65f6e34
Merge pull request #36276 from nogoegst/update-vendor-x-sys
Update golang.org/x/sys vendor
2018-02-11 17:08:15 +09:00
Yong Tang
6453d49d05 Remove integration-cli/docker_cli_pause_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-10 23:03:55 +00:00
Yong Tang
d07d3e7117
Merge pull request #36266 from vdemeester/integration-container-helper
Add an integration/internal/container helper package
2018-02-10 12:57:58 -08:00
Vincent Demeester
0bb7d42b03
Add an integration/internal/container helper package
To help creating/running/… containers using the client for test integration.
This should make test more readable and reduce duplication a bit.

Usage example

```
// Create a default container named foo
id1 := container.Create(t, ctx, client, container.WithName("foo"))
// Run a default container with a custom command
id2 := container.Run(t, ctx, client, container.WithCmd("echo", "hello world"))
```

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-10 17:29:38 +01:00
Ivan Markin
6f66ccaf50 Update golang.org/x/sys vendor to 37707fdb30a5b38865cfb95e5aab41707daec7fd
Signed-off-by: Ivan Markin <sw@nogoegst.net>
2018-02-10 15:58:20 +00:00
Vincent Demeester
3053006679
Merge pull request #36265 from vdemeester/rename-integration-util-to-internal
Rename integration/util to integration/internal
2018-02-10 14:25:28 +01:00
bin liu
b00a67be6e Fix typos in daemon
Signed-off-by: bin liu <liubin0329@gmail.com>
2018-02-10 19:42:54 +08:00
Vincent Demeester
af306d149e
Rename integration/util to integration/internal
Both names have no real sense, but one allows to make sure these packages
aren't used outside of `integration`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-10 09:16:32 +01:00
Sebastiaan van Stijn
ab3ea81376
Merge pull request #36242 from kolyshkin/rwlayer-nil-deref
c.RWLayer: check for nil before use
2018-02-09 18:13:03 -08:00
Yong Tang
2d97f5e780
Merge pull request #36259 from yongtang/02082018-kill_test
Migrate TestKillDifferentUserContainer to api test
2018-02-09 13:47:35 -08:00
Daniel Nephin
5589e9cad1
Merge pull request #36260 from yongtang/02082018-inspect_test
Migrate docker_api_inspect_unix_test.go to integration api test
2018-02-09 13:33:51 -08:00
Yong Tang
9d55eefc1b
Merge pull request #36221 from yongtang/02032018-secret_ls
Migrate secret list tests from integration-cli to api tests
2018-02-09 13:29:19 -08:00
Brian Goff
c0d56ab717 Fix container cleanup on daemon restart
When the daemon restores containers on daemon restart, it syncs up with
containerd to determine the existing state. For stopped containers it
then removes the container metadata from containerd.

In some cases this is not handled properly and causes an error when
someone attempts to start that container again.
In particular, this case is just a bad error check.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-09 14:36:36 -05:00
Kir Kolyshkin
195893d381 c.RWLayer: check for nil before use
Since commit e9b9e4ace2 has landed, there is a chance that
container.RWLayer is nil (due to some half-removed container). Let's
check the pointer before use to avoid any potential nil pointer
dereferences, resulting in a daemon crash.

Note that even without the abovementioned commit, it's better to perform
an extra check (even it's totally redundant) rather than to have a
possibility of a daemon crash. In other words, better be safe than
sorry.

[v2: add a test case for daemon.getInspectData]
[v3: add a check for container.Dead and a special error for the case]

Fixes: e9b9e4ace2
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-02-09 11:24:09 -08:00
Yong Tang
0855922cd3 Migrate TestKillDifferentUserContainer to api test
This fix migrates TestKillDifferentUserContainer to api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 13:40:32 +00:00
Yong Tang
8197529ca2 Migrate docker_api_inspect_unix_test.go to integration api test
This fix migrates docker_api_inspect_unix_test.go to integration api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 12:56:07 +00:00
Yong Tang
7e7f8160fc
Merge pull request #36226 from yongtang/36198-follow-up
Add description to TestContainerNetworkMountsNoChown
2018-02-09 04:39:56 -08:00
Dennis Chen
8f5c1841a8 Fix timeout issue of InspectNetwork on AArch64
Service of inspect network can't be finished within 10s on AArch64 platform,
so we need to adjust the timeout value avoid to paper cover the real issue, plus
to make the integreation test can continue while not terminate with below error:

> === RUN   TestInspectNetwork
> --- FAIL: TestInspectNetwork (27.65s)
>         daemon.go:285: [de79880f4ed4a] waiting for daemon to start
>         daemon.go:317: [de79880f4ed4a] daemon started
>         inspect_test.go:57: timeout hit after 10s: waiting for tasks to enter run state
>         daemon.go:275: [de79880f4ed4a] exiting daemon
> FAIL
> ---> Making bundle: .integration-daemon-stop (in bundles/test-integration)
> Removing test suite binaries
> Makefile:171: recipe for target 'test-integration' failed

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-02-09 03:20:14 +00:00
Yong Tang
afbc9c4cfc
Merge pull request #36213 from yongtang/02052018-rename_test
Migrate rename tests in integration-cli to api tests
2018-02-08 18:38:02 -08:00
Yong Tang
9349c03583 Migrate secret list tests from integration-cli to api tests
This fix migrates secret list tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 00:45:22 +00:00
Yong Tang
42465784dc Remove docker_cli_secret_ls_test.go from integration-cli
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 00:45:08 +00:00
Yong Tang
be24a6b11e Migrate rename tests in integration-cli to api tests
This fix migrates rename tests in integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 23:27:14 +00:00
Yong Tang
15001f83bd
Merge pull request #36241 from yongtang/02072018-create-tests
Migrate TestCreateTmpfsMountsTarget test to api test
2018-02-08 14:58:06 -08:00
Yong Tang
21c9e5701b
Merge pull request #36140 from vdemeester/integration-container-kill
Migrate some kill integration cli test to api tests
2018-02-08 09:55:28 -08:00
Daniel Nephin
12ff002eed
Merge pull request #36235 from yongtang/02072018-info-api-test
Migrates docker info tests to integration api tests
2018-02-08 09:55:08 -08:00
Yong Tang
f601bc16d5 Migrate TestCreateTmpfsMountsTarget test to api test
This fix migrates TestCreateTmpfsMountsTarget test to api test,
and removed integration-cli/docker_cli_create_unix_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 15:59:12 +00:00
Vincent Demeester
6977f468bb
Migrate some calls to new client function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-08 16:21:45 +01:00
Vincent Demeester
f653485e57
Merge pull request #36220 from dnephin/support-proxy-in-splunk-driver
Support a proxy in splunk log driver
2018-02-08 15:32:19 +01:00
Vincent Demeester
2227c8ad5e Move some kill integration cli to api tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-08 15:26:24 +01:00
Vincent Demeester
772edd020c Introduce NewClientWithOpts func to build custom client easily
This allows to create a client with default values and override those
using functors. As an example, `NewEnvClient()` becomes
`NewClientWithOpts(FromEnv)` ; and if you want a different api version
for this client : `NewClientWithOpts(FromEnv, WithVersion("1.35"))`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-08 15:26:24 +01:00
Yong Tang
384ff69f2f
Merge pull request #36173 from cpuguy83/fix_containerd_crash_spin
Refresh containerd remotes on containerd restarted
2018-02-08 06:19:29 -08:00
Yong Tang
6f33b5a2ab
Merge pull request #36243 from thaJeztah/bump-golang-1.9.4
Bump Golang to 1.9.4
2018-02-08 06:17:35 -08:00
Akihiro Suda
9769ef333f
Merge pull request #36224 from dnephin/refactor-commit
Refactor Daemon.Commit()
2018-02-08 21:02:30 +09:00
Sebastiaan van Stijn
250193387c
Remove workaround for Nano server TP5
This workaround for golang/go#15286 was added for Nano server TP5 in
fa82c0aa10, and should no longer be
needed

Due to a security fix in Go 1.9.4/1.8.7, loading the .dll is no longer
allowed, and produces an error:

   .\docker_windows.go:9:3: //go:cgo_import_dynamic main.dummy CommandLineToArgvW%2 "shell32.dll" only allowed in cgo-generated code

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-07 23:38:14 -08:00
Yong Tang
8331a1a5cf Remove integration-cli/docker_cli_create_unix_test.go
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 00:21:29 +00:00
Sebastiaan van Stijn
caeab26843
Bump Golang to 1.9.4
This fixes a vulnerability in `go get` (CVE-2018-6574, http://golang.org/issue/23672),
but shouldn't really affect our code, but it's good to keep in sync.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-07 14:49:51 -08:00
Tianon Gravi
3a633a712c
Merge pull request #36194 from dnephin/add-canonical-import
Add canonical import path
2018-02-07 13:06:45 -08:00
Daniel Nephin
daff039049 Refactor commit
The goal of this refactor is to make it easier to integrate buildkit
and containerd snapshotters.

Commit is used from two places (api and build), each calls it
with distinct arguments. Refactored to pull out the common commit
logic and provide different interfaces for each consumer.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-07 15:09:06 -05:00
Daniel Nephin
3c4537d5b3 Support a proxy in splunk log driver
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-07 14:52:32 -05:00
Daniel Nephin
7d296522f6 update vendor
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-07 14:46:24 -05:00
Yong Tang
68d9beedbe Migrates docker info tests to integration api tests
This fix migrates docker info tests in integration-cli
to integration tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-07 18:26:01 +00:00
Brian Goff
400126f869 Refresh containerd remotes on containerd restarted
Before this patch, when containerd is restarted (due to a crash, or
kill, whatever), the daemon would keep trying to process the event
stream against the old socket handles. This would lead to a CPU spin due
to the error handling when the client can't connect to containerd.

This change makes sure the containerd remote client is updated for all
registered libcontainerd clients.

This is not neccessarily the ideal fix which would likely require a
major refactor, but at least gets things to a working state with a
minimal patch.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-07 11:53:00 -05:00
Sebastiaan van Stijn
2e8ccbb49e
Merge pull request #36201 from arm64b/oom-kill-disable-fixing
Daemon: passdown the `--oom-kill-disable` option to containerd
2018-02-06 21:39:43 -08:00
Sebastiaan van Stijn
4ba4b4b283
Merge pull request #36223 from yongtang/02062018-clean
Combine runSimpleContainer with runContainer for rename test
2018-02-06 17:26:49 -08:00
Yong Tang
28a2187ea7 Add description to TestContainerNetworkMountsNoChown
This fix is a follow up to 36198 by adding description
to TestContainerNetworkMountsNoChown so that it is clear
about the purpose of the test for ownership.

This fix is related to comment in 36198.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-07 00:19:38 +00:00