Commit Graph

1874 Commits

Author SHA1 Message Date
3420db4b5e Fix panic in loading plugins
When a plugin is first found, it is loaded into the available plugins
even though it's not activated yet.
If activation fails it is taken out of the list.
While it is in the list, other callers may see it and try to check it's
manifest. If it is not fully activated yet, the manifest will be nil and
cause a panic.

This is especially problematic for drivers that are down and have not
been activated yet.

We could just not load the plugin into the available list until it's
fully active, however that will just cause multiple of the same plugin
to attemp to be loaded.

We could check if the manifest is nil and return early (instead of
panicing on a nil manifest), but this will cause a 2nd caller to receive
a response while the first caller is still waiting, which can be
awkward.

This change uses a condition variable to handle activation (instead of
sync.Once). If the plugin is not activated, callers will all wait until
it is activated and receive a broadcast from the condition variable
signaling that it's ok to proceed, in which case we'll check if their
was an error in activation and proceed accordingly.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: baac2f48674d42863f9fdca5ef3056b4c6ed707e
Component: engine
2016-03-23 15:34:15 -04:00
4ffd819c8f Windows: Fix mountinfo
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bb68b666c51eb145a4376c239878d1d985afe01e
Component: engine
2016-03-21 22:03:24 -07:00
5fe3bfd34f Merge pull request #21333 from cpuguy83/sigpipe
Don't forward SIGPIPE from client to container
Upstream-commit: 5008a34072e55f7df87774a5e7beca979718c3c2
Component: engine
2016-03-21 15:09:13 +01:00
20351391ce Merge pull request #21274 from jfrazelle/fix-variables-that-werent-being-used
fix variables that werent being called
Upstream-commit: b77573f48e4022c7b8b829c4a33c6963fe08e18a
Component: engine
2016-03-18 18:03:15 -07:00
b070967d75 Merge pull request #21325 from frenkel/openbsd-support
Support OpenBSD build
Upstream-commit: 131c59193f16d1f752103f97302546ec819cb6f7
Component: engine
2016-03-18 20:53:17 -04:00
c955c9e289 Don't forward SIGPIPE from client to container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 81707de23ff6d0b03bd8d5cda87efac7939d9d46
Component: engine
2016-03-18 16:50:18 -04:00
8ba16d91c8 Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 9c4570a958df42d1ad19364b1a8da55b891d850a
Component: engine
2016-03-18 13:38:32 -07:00
8d2c6b65a8 Cli binary can now be build on OpenBSD
Signed-off-by: Frank Groeneveld <frank@frankgroeneveld.nl>
Upstream-commit: 719a43ca3530c424c3875d8c066f7ab09195dfdc
Component: engine
2016-03-18 14:56:21 +01:00
ae0977f1d1 fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 0e025b4bb16c0d4cc6b3f0c040713d061b9b051a
Component: engine
2016-03-17 13:19:55 -07:00
4d8c3b87c5 Merge pull request #21266 from estesp/dockremap-system-user
Change subordinate range-owning user to be a system user
Upstream-commit: 41c1c6501e53698961cfdcab47eb5ab37ede667b
Component: engine
2016-03-17 11:42:15 -07:00
24be9013fa pkg: truncindex: provide more info in error
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: ae1002219bc5d602c552ba952bc45e440cf3aae7
Component: engine
2016-03-17 15:53:12 +01:00
218e901de7 Change subordinate range-owning user to be a system user
Change user/group creation to use flags to adduser/useradd to enforce it
being a system user. Use system user defaults that auto-create a
matching group. These changes allow us to remove all group creation
code, and in doing so we also removed the code that finds available uid,
gid integers and use post-creation query to gather the system-generated
uid and gid.

The only added complexity is that today distros don't auto-create
subordinate ID ranges for a new ID if it is a system ID, so we now need
to handle finding a free range and then calling the `usermod` tool to
add the ranges for that ID. Note that this requires the distro supports
the `-v` and `-w` flags on `usermod` for subordinate ID range additions.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: c18e7f3a0419e35aeab4eefa51f3c17fbd72381f
Component: engine
2016-03-16 18:44:10 -04:00
195d725261 *: fix response body leaks
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: f0d83c4cdb49adb53fdaf4216a4395c23d5cc8e9
Component: engine
2016-03-16 17:15:42 +01:00
6f209e48d5 Remove flush(stdout) in pkg/chrootarchive/diff_unix.go and improve error reporting of flush() to fix #21103
pkg/chrootarchive/diff_unix.go erroneously calls flush on stdout, which tries to read from stdout returning an error.
This has been fixed by removing the call and by modifying flush to return errors and checking for these errors on calls to flush.

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: a9c61691389ed373ada399d25f55a9d10405b4ea
Component: engine
2016-03-15 10:29:51 -07:00
8a5b6da14b Merge pull request #21162 from estesp/copyastar-dir-create
Fix CopyWithTar creation of new destination dir as remapped root
Upstream-commit: 6f2d8b411eaaa6b4ea2a46e5164325450259573b
Component: engine
2016-03-15 10:26:30 -07:00
fab87296b0 Fix flaky test TestJSONFormatProgress (#21124)
In TestJSONFormatProgress, the progress string was used for comparison.
However, the progress string (progress.String()) uses time.Now().UTC()
to generate the timeLeftBox which is not a fixed value and cannot be
compared reliably.

This PR fixes the issue by stripping the timeLeftBox field before doing
the comparison.

This PR fixes #21124.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d17bb23ae6efba6e76e7a56b856705400e26a61b
Component: engine
2016-03-14 16:00:12 +00:00
96d657135e Fix CopyWithTar creation of new destination dir as remapped root
If the destination does not exist, it needs to be created with ownership
mapping to the remapped uid/gid ranges if user namespaces are enabled.
This fixes ADD operations, similar to the prior fixes for COPY and WORKDIR.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 06d95003b3ddd22d26121280d645e48582a4f931
Component: engine
2016-03-12 23:05:45 -05:00
1585d5df26 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: bbeb859b6490a03d7c4265762711b551c22e914d
Component: engine
2016-03-11 23:22:16 +08:00
de84e87a00 pids limit support
update bash commpletion for pids limit

update check config for kernel

add docs for pids limit

add pids stats

add stats to docker client

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 69cf03700fed7bf5eb7fe00c9214737e21478e49
Component: engine
2016-03-08 07:55:01 -08:00
a3ffabb772 Merge pull request #20843 from calavera/plugin_any_transport
Call plugins with custom transports.
Upstream-commit: c08b674d56c37782fc26382f4b756e0518e394cf
Component: engine
2016-03-04 11:59:32 -05:00
684bf382b9 Merge pull request #20872 from duglin/Issue20470
Optimize .dockerignore when there are exclusions
Upstream-commit: 9bc62e6031350d1db24e37cfa4983f719ab5e33b
Component: engine
2016-03-04 09:45:19 +01:00
e0a2d2cb2d Merge pull request #20730 from clnperez/sysinfo-match-ip-case
Match case for IP variables in sysinfo pkg
Upstream-commit: b7bc1ce1a4be4d309395303cdc573922a48bfd72
Component: engine
2016-03-03 08:48:57 -08:00
d784a76fa2 Optimize .dockerignore when there are exclusions
Closes #20470

Before this PR we used to scan the entire build context when there were
exclusions in the .dockerignore file (paths that started with !). Now we
only traverse into subdirs when one of the exclusions starts with that dir
path.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 842b8d8784b132279003580eedd0e9c12b885815
Component: engine
2016-03-03 05:46:24 -08:00
8e7b2d5a4e Merge pull request #20896 from Microsoft/jjh/unit-pkg-integration
Windows CI: Turn off failing unit tests pkg\integration
Upstream-commit: 174959e8bfc56d73d1f4b2ee0247412f67c89a63
Component: engine
2016-03-03 10:41:21 +01:00
6c3e3e43c9 Merge pull request #20894 from Microsoft/jjh/unit-pkg-graphdb
Windows CI: Turn off failing unit tests pkg\graphdb
Upstream-commit: df1941bf0e70dd3f98c2aadcf56e0df5123b8382
Component: engine
2016-03-03 10:40:22 +01:00
0e8c018223 Windows CI: Turn off failing unit tests pkg\integration
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5f2ba2b9ba5d1030dacb6c686d12c6a91c3c0612
Component: engine
2016-03-02 19:37:18 -08:00
e008756651 Windows CI: Turn off failing unit tests pkg\graphdb
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9f5984d93fc4902d15904809015627b959bf11a1
Component: engine
2016-03-02 19:27:41 -08:00
2aa4a4fc21 Windows CI: Turn off failing unit test pkg\fileutils
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3e78ad7be2c702a51c752965ba10d8fa9c6e9738
Component: engine
2016-03-02 19:05:33 -08:00
4a285f2027 Call plugins with custom transports.
Small refactor to be able to use custom transports
to call remote plugins.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 1a630234508bdb12d55425ceebdb0b6523a38578
Component: engine
2016-03-02 12:54:53 -05:00
5416da11e0 Merge pull request #20833 from Microsoft/testunit-archive
Windows CI: Unit Tests stop running failing archive test
Upstream-commit: b18f9cc29b8977bc003fd47aa35e8836345c301d
Component: engine
2016-03-02 08:53:11 +01:00
84f6ed6e39 Merge pull request #20842 from dongluochen/IPv6Support
Handle IPv6 entries in discovery
Upstream-commit: 266a75ac2219455d34aa6346596b936f42c20bcd
Component: engine
2016-03-01 21:03:37 -08:00
e470d00835 Use net.JoinHostPort to handle address format.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: 7554e882dfe3a3eb9ec61457e20a42de528db725
Component: engine
2016-03-01 17:27:30 -08:00
78aa00dac4 Handle IPv6 entries.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: f7c9214e29a81679916b953572173393d5e766e5
Component: engine
2016-03-01 16:56:12 -08:00
f7b441f49a Windows CI: Unit Tests stop running failing chrootarchive tests
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 7f6ef097369808d1d4eda52ff7bf0d76579741aa
Component: engine
2016-03-01 14:28:29 -08:00
fe36785c66 Windows CI: Unit Tests stop running failing archive test
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: f9cfc4c38779ea8f443c79eeb8cc1b81e8e8a5e1
Component: engine
2016-03-01 13:27:44 -08:00
e740d4f911 Merge pull request #20587 from MHBauer/termfixes
do not turn post-processing on for linux-cgo terminals
Upstream-commit: bcc59fc95125e21ad59129189ff953b7086ab497
Component: engine
2016-03-01 11:37:26 -05:00
9fe49cb009 Match case for variables in sysinfo pkg
I noticied an inconsistency when reviewing docker/pull/20692.

Changing Ip to IP and Nf to NF.

More info: The golang folks recommend that you keep the initials consistent:
https://github.com/golang/go/wiki/CodeReviewComments#initialisms.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 5b3fc7aab25be908cab869dab5c0b2cb821d31dc
Component: engine
2016-03-01 10:37:05 -06:00
8066a67875 Merge pull request #20791 from Microsoft/jjh/testunit-pkgsymlink
Windows CI: Turning off pkg\symlink unit testing
Upstream-commit: dac18985fa5265c38a170b733d49a8ad31d2c645
Component: engine
2016-03-01 08:18:44 +01:00
6a88816da7 Merge pull request #20782 from estesp/new-parent-dir-ownership
Fix ownership of non-existing parent dir
Upstream-commit: 67b16c73818726d9818d0229fa6cdda3e5f698b0
Component: engine
2016-03-01 01:45:38 +01:00
d5b5c504a1 Windows CI: Turning off pkg\symlink unit testing
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: eaa1708e703427a47f28eb198942f18b9d7237d8
Component: engine
2016-02-29 13:10:50 -08:00
24e2f8a0e5 Merge pull request #20492 from WeiZhang555/export-no-privilege
Clean redundant error message for export
Upstream-commit: d878f512fd70928b28ca13629eb58befc14700f5
Component: engine
2016-02-29 21:14:28 +01:00
7d62a9ef68 Merge pull request #20780 from runcom/revert-sudo-user
Revert sudo user
Upstream-commit: a5d98b82ea641349640d07b2f62a047b94592a5e
Component: engine
2016-02-29 11:48:24 -08:00
569a4e8006 Merge pull request #20686 from clintonskitson/bugfix/plugin_desc_leak
Fix plugin file descriptor leaks
Upstream-commit: 29b2b0c22ba4a9c81002cd70e464ef0cfc577413
Component: engine
2016-02-29 10:44:36 -08:00
4b3ca35355 Merge pull request #20602 from twistlock/20508_authz_plugin_corrupt_body
Fix #20508 - Authz plugin enabled with large text/JSON POST payload corrupts body
Upstream-commit: abbb16d7abd7150a9226252f2544326930ea2baf
Component: engine
2016-02-29 10:43:02 -05:00
848fd14888 Fix ownership of non-existing parent dir
During "COPY" or other tar unpack operations, a target/destination
parent dir might not exist and should be created with ownership of the
root in the right context (including remapped root when user namespaces
are enabled)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 7a61b9ae425e5c100da2bb32b929031c6302b3fb
Component: engine
2016-02-29 09:14:23 -05:00
c762170458 Revert "resolve the config file from the sudo user"
This reverts commit afde6450ee7bd4a43765fdc0a9799b411276d9e4.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 863b5716173db320ddc03847a639964f495a7953
Component: engine
2016-02-29 13:51:43 +01:00
79c9ac5435 Merge pull request #20706 from calavera/remove_concurrent_access_to_stdtypes
Make stdcopy.StdWriter thread safe.
Upstream-commit: ec268be52ee3a2fab5c792ecf836f109595712ae
Component: engine
2016-02-27 21:14:09 -05:00
fac52dba98 Fixes plugin file descriptor leak on plugin discovery
Signed-off-by: Clinton Kitson <clintonskitson@gmail.com>
Upstream-commit: 799ae78b7efa9ffb8e142a0a211325cca59987be
Component: engine
2016-02-26 19:43:50 -08:00
84d241709b Make stdcopy.stdWriter goroutine safe.
Stop using global variables as prefixes to inject the writer header.
That can cause issues when two writers set the length of the buffer in
the same header concurrently.

Stop Writing to the internal buffer twice for each write. This could
mess up with the ordering information is written.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 443a5c20216b5331b1bb57796140c0178ca44b7d
Component: engine
2016-02-26 16:51:18 -05:00
8491fb072b pkg: idtools: fix subid files parsing
Since Docker is already skipping newlines in /etc/sub{uid,gid},
this patch skips commented out lines - otherwise Docker fails to start.
Add unit test also.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: bf04d68db2b808a40fa24ac2bfa86c8af22d5f11
Component: engine
2016-02-26 15:42:05 +01:00