Commit graph

34977 commits

Author SHA1 Message Date
Kir Kolyshkin
d3ebcde82a daemon.cleanupMounts(): use mount.SingleEntryFilter
Use mount.SingleEntryFilter as we're only interested in a single entry.

Test case data of TestShouldUnmountRoot is modified accordingly, as
from now on:

1. `info` can't be nil;

2. the mountpoint check is not performed (as SingleEntryFilter
   guarantees it to be equal to daemon.root).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-19 14:48:25 -07:00
Kir Kolyshkin
bb934c6aca pkg/mount: implement/use filter for mountinfo parsing
Functions `GetMounts()` and `parseMountTable()` return all the entries
as read and parsed from /proc/self/mountinfo. In many cases the caller
is only interested only one or a few entries, not all of them.

One good example is `Mounted()` function, which looks for a specific
entry only. Another example is `RecursiveUnmount()` which is only
interested in mount under a specific path.

This commit adds `filter` argument to `GetMounts()` to implement
two things:
 1. filter out entries a caller is not interested in
 2. stop processing if a caller is found what it wanted

`nil` can be passed to get a backward-compatible behavior, i.e. return
all the entries.

A few filters are implemented:
 - `PrefixFilter`: filters out all entries not under `prefix`
 - `SingleEntryFilter`: looks for a specific entry

Finally, `Mounted()` is modified to use `SingleEntryFilter()`, and
`RecursiveUnmount()` is using `PrefixFilter()`.

Unit tests are added to check filters are working.

[v2: ditch NoFilter, use nil]
[v3: ditch GetMountsFiltered()]
[v4: add unit test for filters]
[v5: switch to gotestyourself]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-19 14:48:09 -07:00
Brian Goff
e396b27b7f
Merge pull request #36886 from vdemeester/experimental-plugins-migration
Migrate test-integration-cli experimental plugin tests to integration
2018-04-19 16:13:05 -04:00
Vincent Demeester
69bab3832c
Migrate test-integration-cli experimental plugin tests to integration
All `plugins` tests that require an `ExperimentalDaemon` are migrated
to `integration/plugin/*` and start an experimental daemon to test on
it.

The end goal being to remove the `experimental` build.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-19 11:57:28 +02:00
Vincent Demeester
8bb5a28eed
Merge pull request #36684 from cpuguy83/bump_containerd_client
Bump containerd client
2018-04-19 10:38:43 +02:00
Sebastiaan van Stijn
f1783da736
Merge pull request #36865 from vdemeester/integration-move-swarm-plugin-test
Migrate TestAPISwarmServicesPlugin to integration
2018-04-18 21:15:59 -07:00
Sebastiaan van Stijn
f0b2f9362f
Merge pull request #36894 from cpuguy83/bump_x_net
Bump golang.org/x/net to go1.10 release commit
2018-04-18 18:04:51 -07:00
Sebastiaan van Stijn
69a5611dde
Merge pull request #36848 from cpuguy83/libcontainerd_client_locking
Relax some libcontainerd client locking
2018-04-18 16:47:23 -07:00
Brian Goff
6cd806aa53
Merge pull request #36637 from cpuguy83/no_global_driver_store
No global volume driver store
2018-04-18 16:32:23 -04:00
Brian Goff
848ef1da8b Bump golang.org/x/net to go1.10 release commit
The primary need for this is x/net/context now is just a type alias to
the stdlib context package.
This makes issues with conflicts between "golang.org/x/net/context" and
the stdib "context" go away (primarily a concern in interface
definitions/implementations).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-18 15:57:24 -04:00
Vincent Demeester
aa0db6f9e1
Migrate TestAPISwarmServicesPlugin to integration
Also starts to create more "poll/check" function to `internal/test/daemon`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-18 16:18:53 +02:00
Vincent Demeester
25ff68a80f
Merge pull request #36832 from vdemeester/integration-daemon-api-helpers
More integration-cli/integration refactoring + request package
2018-04-18 16:12:14 +02:00
Brian Goff
4923f8cc63
Merge pull request #36858 from j-haj/36414-standardize_build_paths
Standardize artefact path for all build stages
2018-04-18 06:58:38 -04:00
Akihiro Suda
5dae4828f3
Merge pull request #36880 from thaJeztah/bump-swarmkit
Bump SwarmKit to 9c2aa152c3054371b833483a7ddad8d15052ec4f
2018-04-18 19:10:55 +09:00
Sebastiaan van Stijn
333b2f28fe
Bump SwarmKit to 9c2aa152c3054371b833483a7ddad8d15052ec4f
Relevant changes:

- docker/swarmkit#2551 RoleManager will remove deleted nodes from the cluster membership
- docker/swarmkit#2574 Scheduler/TaskReaper: handle unassigned tasks marked for shutdown
- docker/swarmkit#2561 Avoid predefined error log
- docker/swarmkit#2557 Task reaper should delete tasks with removed slots that were not yet assigned
- docker/swarmkit#2587 [fips] Agent reports FIPS status
- docker/swarmkit#2603 Fix manager/state/store.timedMutex

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-17 13:44:49 -07:00
Brian Goff
977109d808 Remove use of global volume driver store
Instead of using a global store for volume drivers, scope the driver
store to the caller (e.g. the volume store). This makes testing much
simpler.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-17 14:07:08 -04:00
Brian Goff
b047f675ea Rename volumedrivers package to drivers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-17 14:06:53 -04:00
Brian Goff
0023abbad3 Remove old/uneeded volume migration from vers 1.7
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-17 14:06:53 -04:00
Brian Goff
63826e291b Move direct volume driver interaction to store
Since the volume store already provides this functionality, we should
just use it rather than duplicating it.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-17 14:06:53 -04:00
Brian Goff
806700e410 Relax global client lock on containerd restore.
This unblocks the client to take other restore requests and makes sure
that a long/stuck request can't block the client forever.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-17 12:07:06 -04:00
Vincent Demeester
42f6fdf059
Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 16:25:59 +02:00
Vincent Demeester
9722214c8a
Add api helpers to internal/test/daemon.Daemon
Porting helpers from `integration-cli/daemon.Daemon` to this struct
and use the API instead of the cli.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 16:24:31 +02:00
Vincent Demeester
648ae4979e
Merge pull request #36868 from vdemeester/integration-move-fake-internal
Move fakecontext, fakegit and fakestorage to internal/test
2018-04-17 16:23:22 +02:00
Jeff Hajewski
00555f7b26 Standardize artefact path for all build stages
Update all build stages to output artefacts to /build

Signed-off-by: Jeff Hajewski <jeff.hajewski@gmail.com>
2018-04-17 09:08:25 -05:00
Vincent Demeester
062564084a
Move fakecontext, fakegit and fakestorage to internal/test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 09:53:09 +02:00
Sebastiaan van Stijn
13771fede3
Merge pull request #36866 from fntlnz/poule-assign-pr-fntlnz
Add myself to poule to get 2w/old PRs
2018-04-16 18:32:32 -07:00
Anusha Ragunathan
abb1661907
Merge pull request #36841 from yongtang/02222018-tag-test
Migrate image tag tests from integration-cli to api tests
2018-04-16 17:53:48 -07:00
Anusha Ragunathan
f9c4e63026
Merge pull request #36838 from vdemeester/integration-fixtures-refactoring
Clean some integration-cli/fixtures package/files
2018-04-16 17:49:29 -07:00
Anusha Ragunathan
c65d365eb3
Merge pull request #36854 from vdemeester/integration-swarm-more-in-internal
[test/integration] Small daemon refactoring and add swarm init/join helpers
2018-04-16 12:49:49 -07:00
Lorenzo Fontana
691e0c06ce
Add myself to poule to get 2w/old PRs
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-04-16 18:33:21 +02:00
Vincent Demeester
5f56503f58
Clean some integration-cli/fixtures package/files
- Move go package used by both `integration-cli` and `integration` to
  `internal/test/fixtures`.
- Remove fixtures that are not used anymore (moved to `docker/cli` a
  while ago) : deploy, notary, secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-16 10:48:58 +02:00
Vincent Demeester
239a8a5189
Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-16 10:20:10 +02:00
Yong Tang
ea579a6194
Merge pull request #36862 from yongtang/04152018-container.Create
Some enhancement in integration tests
2018-04-15 09:12:52 -07:00
Yong Tang
5c2e6064a1
Merge pull request #36738 from Microsoft/jjh/getlayerpath
Windows: Add GetLayerPath implementation in graphdriver
2018-04-14 09:59:38 -07:00
Yong Tang
ab9bb47b05 Some enhancement in integration tests
This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-14 16:52:02 +00:00
Tibor Vass
61138fb5fc
Merge pull request #35739 from thaJeztah/bump-go-1.10
Bump Golang to 1.10.1
2018-04-13 13:56:38 -10:00
Sebastiaan van Stijn
3881f1a521
Merge pull request #36845 from medakk/refactor-daemon
Refactor code in cmd/dockerd/daemon.go
2018-04-13 15:26:48 -07:00
Sebastiaan van Stijn
a9f502d04b
Merge pull request #36839 from vdemeester/integration-registry-refactoring
Move and refactor integration-cli/registry to internal/test
2018-04-13 15:02:53 -07:00
Yong Tang
9bcb960508 Migrate image tag tests from integration-cli to api tests
This fix migrates image tag tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-13 14:46:40 +00:00
Vincent Demeester
66de2e6e3b
Move and refactor integration-cli/registry to internal/test
- Move the code from `integration-cli` to `internal/test`.
- Use `testingT` and `assert` when creating the registry.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-13 10:45:34 +02:00
Akihiro Suda
544ec0994f
Merge pull request #36840 from cpuguy83/bump_libnetwork
Bump libnetwork commit
2018-04-13 13:54:52 +09:00
Anusha Ragunathan
ff6a103067
Merge pull request #36778 from odg0318/master
Using authorization plugin, I changed Content-Type check routine.
2018-04-12 17:39:38 -07:00
Anusha Ragunathan
9689059b56
Merge pull request #35831 from anusha-ragunathan/splunk_partial
Improve partial message support in logger
2018-04-12 17:38:27 -07:00
Sebastiaan van Stijn
f238bfda90
Merge pull request #36727 from tiborvass/fix-master-ci-gitcommit
ci: quote bash variable
2018-04-12 14:06:22 -07:00
John Stephens
ee508d47c3
hack/make.ps1: fix Validate-PkgImports
In Go 1.10.1, the Deps for pkg\tarsum\tarsum_test.go are empty ([]) and
the PowerShell script ends up setting its import list to a string value
of False instead of an empty array. This can be remedied by forcing the
result to be an array, by concatenating to an empty array (@() + ...)

Signed-off-by: John Stephens <johnstep@docker.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit ec3f9230d70506c536a24e844da0f0b3af9b43f6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:37:10 -07:00
Kir Kolyshkin
66720189e0
archive/tar: vendor again
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 7b30fd0e1d8bc77f0556181c82f85d046b058f27)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:36:58 -07:00
Derek McGowan
c208f1c8a8
Update logger adapter test to avoid race
Add synchronization around adding logs to a plugin
and reading those logs. Without the follow configuration,
a race occurs between go routines to add the logs into
the plugin and read the logs out of the plugin. This
adds a function to synchronize the action to avoid the
race.
Removes use of file for buffering, instead buffering whole
messages so log count can be checked discretely.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:35:15 -07:00
Derek McGowan
fb170206ba
Set format in archiver
Prevent changing the tar output by setting the format to
PAX and keeping the times truncated.
Without this change the archiver will produce different tar
archives with different hashes with go 1.10.
The addition of the access and changetime timestamps would
also cause diff comparisons to fail.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:34:33 -07:00
Derek McGowan
a422774e59
Fix tarsum for go 1.10
Remove invalid flush commands, flush should only occur when file
has been completely written. This is already handle, remove these calls.
Ensure data gets written after EOF in correct order and before close.
Remove gname and uname from sum for hash compatibility.
Update tarsum tests for gname/uname removal.
Return valid length after eof.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:34:14 -07:00
Sebastiaan van Stijn
950a1aa317
Remove patched "archive/tar" package
This fix is now upstream in Go 1.10

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:33:33 -07:00