Commit Graph

5872 Commits

Author SHA1 Message Date
b21cab8bb2 Merge pull request #37110 from thaJeztah/remove-testutil-errorcontains
Replace deprecated testutil.ErrorContains()
Upstream-commit: 9bd5d9912f0cb4fe22b994ac1e7e10038e3be65a
Component: engine
2018-05-21 11:04:45 -07:00
fac8e1d52b Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 55bebbaecf5e40db9d83b28080ce08dc8642f407
Component: engine
2018-05-21 00:13:04 +02:00
91ebfe260a aufs: log reason why aufs is not supported.
In case aufs driver is not supported because supportsAufs() said so,
it is not possible to get a real reason from the logs.

To fix, log the error returned.

Note we're not using WithError here as the error message itself is the
sole message we want to print (i.e. there's nothing to add to it).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 91f85d1c784f3dc9d892b2af2f51d6b6f3b0be69
Component: engine
2018-05-20 12:02:41 +02:00
30e8f43743 aufs: use a single logger
Simplify the code by using a single logger instance.

While at it, use WithError in Umount.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c6e2af54256211b8ac757e9b25caa6fb6c9b3c6e
Component: engine
2018-05-20 12:02:12 +02:00
c03259c23d Merge pull request #37022 from cgxu519/overlayutils-addmsg
Add additional message when backendfs is extfs without d_type support
Upstream-commit: f9dd74deee364dd513615ea112e78008a946b3e5
Component: engine
2018-05-19 22:38:45 +02:00
3b0918309f Merge pull request #37088 from ohbarye/fix-typos-duplicated-the
Fix typos: remove duplicated "the"
Upstream-commit: 3646562a5cfbf93f987d0ccffe7ca1c3487036e2
Component: engine
2018-05-19 20:57:47 +02:00
1ed95ff31a Merge pull request #37091 from thaJeztah/fix-linting-errors
Fix some linting issues
Upstream-commit: 1b75e175842e5ef59284a1c8ca7d64e4d6b62384
Component: engine
2018-05-19 08:39:39 -10:00
c3521e7da6 Add additional message when backendfs is extfs without d_type support
ext4 support d_type by default, but filetype feature is a tunable so
there is still a chance to disable it for some reasons. In this case,
print additional message to explicitly tell how to support d_type.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Upstream-commit: 8a21b128d4deb874c05eb81ebbc1265175ad69ba
Component: engine
2018-05-18 10:32:47 +08:00
e4bec6da7c Merge pull request #37084 from nwneisen/update-ring-buffer-documents
Update documentation for RingLogger's ring buffer
Upstream-commit: 59698778fe9301225c456886f7b67d2e43703a05
Component: engine
2018-05-17 12:10:44 -07:00
7f78f7fe15 Fix some linting issues
These showed locally when running `make validate`. CI doesn't seem to have the
same (possibly it's disabled in the configuration)

    builder/fscache/fscache.go:618::error: github.com/docker/docker/vendor/github.com/tonistiigi/fsutil.StatInfo composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:44::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:20::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:113::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:110::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:171::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:413::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:203::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:584::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:109::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:388::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/volumes_windows.go:27::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    integration/service/network_test.go:31::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    api/server/server.go:129:10⚠️ should not use basic type string as key in context.WithValue (golint)
    integration/service/network_test.go:54::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:61::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:74::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    pkg/archive/archive_windows.go:76::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    plugin/manager_linux.go:56::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4f8c870d623c63b98f8ef8002448f07f4dda4aa9
Component: engine
2018-05-17 19:28:27 +02:00
3d5979d637 Merge pull request #37075 from tuscloud/fix-typos
Fix typos
Upstream-commit: 9aac187ce1592249ab5f1556d362f2b48ff9c671
Component: engine
2018-05-17 16:00:43 +02:00
111037b920 Fix typos: remove duplicated "the"
Signed-off-by: Masato Ohba <over.rye@gmail.com>
Upstream-commit: 0f95b23d98384a3ae3769b75292cd5b14ba38437
Component: engine
2018-05-17 21:49:51 +09:00
7321d16dc7 Update documentation for RingLogger's ring buffer
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
Upstream-commit: 3521d534e5c9338ae5605d1228554862e922a8a9
Component: engine
2018-05-16 18:52:50 -06:00
9e6796b652 Fix typos
Signed-off-by: weipeng <weipeng@tuscloud.io>
Upstream-commit: f781ec45b5c1745279f0429c2b7f19c793efcb85
Component: engine
2018-05-16 09:15:43 +08:00
131639fdf7 Merge pull request #37028 from cpuguy83/log_plugin_broken_pipe
Fix logging plugin crash unrecoverable
Upstream-commit: 6821ffd1a11f188d6b1c3e8da01885768e027586
Component: engine
2018-05-15 13:57:01 +02:00
9ebdda8c43 Merge pull request #37033 from cpuguy83/some_container_network_cleanups
Some container/network cleanups
Upstream-commit: 6f68db8c7a94489b5e66bb828f748d0baa2e5c22
Component: engine
2018-05-15 13:23:41 +02:00
14395e1de7 Merge pull request #37062 from cpuguy83/fix_logs_daemon_race
Fix race conditions in logs API
Upstream-commit: 07dc3aa685ffd500ada1c41f8a9b7eaf74cf09eb
Component: engine
2018-05-15 11:59:40 +02:00
f2fea2ebf4 Merge pull request #37063 from cpuguy83/fix_log_rotation_issue
Fix some issues in logfile reader and rotation
Upstream-commit: 26da99e326bf7cbfad820395f5379bba7a66c4a5
Component: engine
2018-05-15 11:46:29 +02:00
4347082deb Merge pull request #37060 from cpuguy83/fix_swagger_gen
Fix swagger volume type generation
Upstream-commit: bcd86fc2acd3ef22a7fc6c662c7ae8a67b0bb4f4
Component: engine
2018-05-15 11:46:02 +02:00
9488201604 Fix logging plugin crash unrecoverable
In cases where a logging plugin has crashed when the daemon tries to
copy the container stdio to the logging plugin it returns a broken pipe
error and any log entries that occurr while the plugin is down are lost.

Fix this by opening read+write in the daemon so logs are not lost while
the plugin is down.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e7479e3ab8128f9e84cc640f0bed4e77b268a6e9
Component: engine
2018-05-14 16:51:56 -04:00
b600301f4e Fix some issues in logfile reader and rotation
- Check errors.Cause(err) when comparing errors
- Fix bug where oldest log file is not actually removed. This in
particular causes issues when compression is enabled. On rotate it just
overwrites the data in the log file corrupting it.
- Use O_TRUNC to open new gzip files to ensure we don't corrupt log
files as happens without the above fix.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e87e9e6ad6ba501cc42a2ef47ac18c88a68f258f
Component: engine
2018-05-14 15:52:18 -04:00
5e354ed533 Fix race conditions in logs API
Closing the log driver was in a defer meanwhile logs are
collected asyncronously, so the log driver was being closed before reads
were actually finished.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2c252a48c252749d41079cf8c450d00a5c18296e
Component: engine
2018-05-14 15:48:32 -04:00
1cb0dc30a7 Fix swagger volume type generation
This was broken by bf6a790f00ab96bb8857e3c73502909ee5e36217

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b16b125bb4326e2eec9948fd54ca8c5d83eba36a
Component: engine
2018-05-14 13:46:20 -04:00
de8a0bba09 Merge pull request #37034 from cpuguy83/moar_metrics
Add metrics for log failures/partials
Upstream-commit: ab0dccf80174fa5eef4583a0235b0bf57bdff8df
Component: engine
2018-05-14 18:05:30 +02:00
70cd643c8a Merge pull request #37040 from thaJeztah/error_on_unsupported_options
overlay: do not ignore invalid storage-driver options
Upstream-commit: a79d04ae55196f73d67eeb8a40cfbeb67fed95e9
Component: engine
2018-05-14 15:37:33 +02:00
7fb4806d90 Merge pull request #36991 from kolyshkin/slice-in-place
daemon.setMounts(): copy slice in place
Upstream-commit: 31aca4bef4d976ae4e7fb559da52745a3a295100
Component: engine
2018-05-14 13:49:47 +02:00
e72e7fdac6 Merge pull request #37045 from abhi/inspect
Fixing network inspect for swarm
Upstream-commit: 8baea3a1bb9a10e4148e320d8933b0a73b7e0b07
Component: engine
2018-05-14 12:51:12 +02:00
4ca879c241 Fixing network inspect for swarm
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Upstream-commit: a059d6f4f5eb5fdb319b6f715a9bb50eb5d6173d
Component: engine
2018-05-13 07:31:14 -07:00
3d482c77f6 Merge pull request #37041 from thaJeztah/remove_unused_function_in_test
overlay2: remove unused cdMountFrom() helper function
Upstream-commit: d0a516e2567a67fed3ff3f23ff6c220f1707ad4b
Component: engine
2018-05-11 13:56:56 -04:00
0178ff5bea Merge pull request #37031 from kolyshkin/getmnt
Fix daemon.getSourceMount() for /
Upstream-commit: 379845ec20ae651831dcfb0587b95c38a1631a53
Component: engine
2018-05-11 16:39:57 +02:00
b80e078a6d Merge pull request #36815 from allencloud/simplify-ode
refactor: simplify code to make function getExecConfig  more readable
Upstream-commit: 64336838878281549d87b34b19cf2e4b3756e724
Component: engine
2018-05-11 10:06:33 -04:00
0d708bdf61 overlay2: remove unused cdMountFrom() helper function
This function was added in 23e5c94cfb26eb72c097892712d3dbaa93ee9bc0 but never used

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8a8ec00c1fece033b20548b7a5ec2f3a1f340834
Component: engine
2018-05-11 13:51:50 +02:00
5da69b8b39 overlay: do not ignore invalid storage-driver options
The overlay storage driver currently does not support any option, but was silently
ignoring any option that was passed.

This patch verifies that no options are passed, and if they are passed will produce
an error.

Before this change:

    dockerd --storage-driver=overlay --storage-opt dm.thinp_percent=95
    INFO[2018-05-11T11:40:40.996597152Z] libcontainerd: started new docker-containerd process  pid=256
    ....
    INFO[2018-05-11T11:40:41.135392535Z] Daemon has completed initialization
    INFO[2018-05-11T11:40:41.141035093Z] API listen on /var/run/docker.sock

After this change:

    dockerd --storage-driver=overlay --storage-opt dm.thinp_percent=95
    INFO[2018-05-11T11:39:21.632610319Z] libcontainerd: started new docker-containerd process  pid=233
    ....
    Error starting daemon: error initializing graphdriver: overlay: unknown option dm.thinp_percent

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 30f15d2bdc551870464d1cd024a92341cf1ae4aa
Component: engine
2018-05-11 13:40:46 +02:00
52ce230729 Add metrics for log failures/partials
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 673dd28e7e2fb6e40e4c56823900fdb152b9c53c
Component: engine
2018-05-10 17:22:37 -04:00
c6a8d2ea17 Move network operations out of container package
These network operations really don't have anything to do with the
container but rather are setting up the networking.

Ideally these wouldn't get shoved into the daemon package, but doing
something else (e.g. extract a network service into a new package) but
there's a lot more work to do in that regard.
In reality, this probably simplifies some of that work as it moves all
the network operations to the same place.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: cc8f358c23d307d19b06cd5e7d039d8fad01a947
Component: engine
2018-05-10 17:16:00 -04:00
53eaee8346 daemon.getSourceMount(): fix for / mount point
A recent optimization in getSourceMount() made it return an error
in case when the found mount point is "/". This prevented bind-mounted
volumes from working in such cases.

A (rather trivial but adeqate) unit test case is added.

Fixes: 871c957242 ("getSourceMount(): simplify")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d8fd6137a1f6d95a2bcdfeb6e1dfa6b816790c5e
Component: engine
2018-05-10 12:53:37 -07:00
d10b7a563e Fix fluentd partial detection
The Partial property of the Logger message
was replaced by PLogMetaData, causing the build to fail.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: daaef83cd24f6eb335b77e9d8d692235eff1b201
Component: engine
2018-05-10 01:55:27 +02:00
bc1299683c Merge pull request #36159 from cosmo0920/add-partial-flag-into-record
Fluentd Log Driver: Add partial flag into record
Upstream-commit: fff01bc14d96b323ecafb18f8c33c62561677fbb
Component: engine
2018-05-09 21:01:05 +02:00
194bacfc7b Merge pull request #36921 from cyli/filter-namespaced-labels
Warn when reserved-namespace engine labels are configured
Upstream-commit: 57493cd60628ebf6e8b02725f44e1a4ef152a39e
Component: engine
2018-05-07 15:12:52 +02:00
b2b2305fac daemon.setMounts(): copy slice in place
It does not make sense to copy a slice element by element, then discard
the source one. Let's do copy in place instead which is way more
efficient.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d4c94e83ca58b5ffd99840a8e3cbf22f1ab331c0
Component: engine
2018-05-03 10:26:06 -07:00
87f255b417 Merge pull request #36396 from selansen/master
Allow user to specify default address pools for docker networks
Upstream-commit: 82d9185470c99d5768b60926648b3739ec15bbc4
Component: engine
2018-05-03 06:34:14 -04:00
0074e6a87b Merge pull request #36522 from IRCody/awslogs-non-blocking
Allow awslogs to use non-blocking mode
Upstream-commit: fe2d3a1551f666465e65ec4337e92b774a5e81f1
Component: engine
2018-05-01 16:30:52 -04:00
b9f36ffdf0 Allow user to control the default address pools
- Via daemon flag --default-address-pools base=<CIDR>,size=<int>

Signed-off-by: Elango Siva  <elango@docker.com>
Upstream-commit: 173b3c364ebedd56bd5b6c190a9b41f592ba57d6
Component: engine
2018-04-30 11:14:08 -04:00
257c410f05 Allow awslogs to use non-blocking mode
When then non-blocking mode is specified, awslogs will:

- No longer potentially block calls to logstream.Log(), instead will
  return an error if the awslogs buffer is full. This has the effect of
  dropping log messages sent to awslogs.Log() that are made while the
  buffer is full.
- Wait to initialize the log stream until the first Log() call instead of in
  New(). This has the effect of allowing the container to start in
  the case where Cloudwatch Logs is unreachable.

Both of these changes require the --log-opt mode=non-blocking to be
explicitly set and do not modify the default behavior.

Signed-off-by: Cody Roseborough <crrosebo@amazon.com>
Upstream-commit: c7e379988c9cd6ec0af528e6f59eea3c51b36738
Component: engine
2018-04-27 17:59:03 +00:00
256deb9131 Merge pull request #36924 from runcom/fix-created-rp
restartmanager: do not apply restart policy on created containers
Upstream-commit: 18bfe3c12838ccec3d6a749f6d71355c1daed164
Component: engine
2018-04-25 21:48:01 +02:00
d865a73a75 Filter engine labels to exclude com.docker.*, io.docker.*, and org.dockerproject.*
labels as per https://docs.docker.com/config/labels-custom-metadata/.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: d1d7bcd6d73516af5ae70c01bf08a0f73ad87743
Component: engine
2018-04-24 11:42:09 -07:00
153889840e Merge pull request #36599 from Microsoft/jjh/dockersave
LCOW: Implement `docker save`
Upstream-commit: 65c575f592a247b3dd0d10dd707f1bbf3d459ae1
Component: engine
2018-04-24 11:14:32 -07:00
e77630ac6d restartmanager: do not apply restart policy on created containers
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 75d3214934b397692a2765ef6fd8ce086044831b
Component: engine
2018-04-24 11:41:09 +02:00
e3af8e0774 Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7d62e40f7e4f3c17d229a7687d6fcca5448de813
Component: engine
2018-04-23 13:52:44 -07:00
5a3297f67b Merge pull request #36913 from vdemeester/test-skip-non-root
Skip some tests requires root uid when run as user…
Upstream-commit: 5c233cf4315747785b27d4b0f0631d220556205f
Component: engine
2018-04-23 11:42:42 -07:00