Commit Graph

2073 Commits

Author SHA1 Message Date
7c9671c819 fix spec file support for Windows plugin discovery (#25903)
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
Upstream-commit: 52c0daad82b424afc661c23c1d80784d014e1a58
Component: engine
2016-08-26 22:11:58 +02:00
e263ef28d9 Remove old cli framework.
Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 14712f9ff0d20a3b64a60103608b8cc998909242
Component: engine
2016-08-25 13:09:04 -04:00
501f88a28e Add testutil/tempfile
Improve error messages raised by assert.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7c556849aa7362cfa81ae316275e17eeb50bb52b
Component: engine
2016-08-25 13:09:03 -04:00
3a9a2cf24a Merge pull request #25967 from valgaze/feat/lewin
Add Daniel Lewin to names collection
Upstream-commit: 4d590ba44a983ad881a2b44d8cd6ad6ebc5c6935
Component: engine
2016-08-24 20:28:55 +02:00
598c701bb9 Merge pull request #25959 from estesp/fail-on-graphdir-perms
Don't start daemon in userns mode if graphdir inaccessible
Upstream-commit: 4a1b048c1539ca67c8be5fd3d12fe10f65ee600e
Component: engine
2016-08-24 20:15:58 +02:00
3db3e5b8dc Merge pull request #25426 from dnephin/better-int-testing-cmd
Remove duplicate RunCommand functions used for integration-cli
Upstream-commit: b29558ed5d68712a40d840e289ada232f912659f
Component: engine
2016-08-24 11:34:24 -04:00
b5333a8cfd Don't start daemon in userns mode if graphdir inaccessible
Warn the user and fail daemon start if the graphdir path has any
elements which will deny access to the remapped root uid/gid.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 43a1df6be2fa0c76b521680bbd5dc84db2cfd898
Component: engine
2016-08-24 11:25:30 -04:00
bc4f1a4d25 Add system.Stat support for darwin/macOS
darwin had unbuildable support for our system.Stat() implementation.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 76a416ac37e5bd184990c93ed19aa6fa544b7b03
Component: engine
2016-08-24 11:25:26 -04:00
c95e648ece Add Joan Clarke to name collection
Signed-off-by: Victor Algaze <valgaze@gmail.com>
Upstream-commit: 479b793a3efa1b07a9620ddd60c065c6b06e07c3
Component: engine
2016-08-24 01:58:48 -07:00
cddca309b9 Add Daniel Lewin to names collection
Signed-off-by: Victor Algaze <valgaze@gmail.com>
Upstream-commit: bc0e2f1a6ebf6f9235ee8aa921570533db1ec57a
Component: engine
2016-08-23 23:24:29 -07:00
1a72f2bb5c Fix AuthZ plugins headers change issue
This fix tries to address the issue raised in 25927 where
the HTTP headers have been chaged when AUthZ plugin is in
place.

This issue is that in `FlushAll` (`pkg/authorization/response.go`),
the headers have been written (with `WriteHeader`) before all the
headers have bee copied.

This fix fixes the issue by placing `WriteHeader` after.

A test has been added to cover the changes.`

This fix fixes 25927

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9cb8fb6ea03fcd78010ce7dd33585d96cd73e38c
Component: engine
2016-08-23 21:08:23 -07:00
6f1ee045aa Merge pull request #25903 from anusha-ragunathan/windows_plugin_spec
Add spec file support for Windows plugin discovery.
Upstream-commit: 8c5c2842ba8a6d4ec74b20fc703730eca60aeffb
Component: engine
2016-08-23 19:45:54 -04:00
0d4234bb46 Change to use c.Assert() instead of result.Assert()
Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 243885808f5c69143679d094d964d333c47e69bf
Component: engine
2016-08-23 15:12:36 -04:00
eaa727c6e2 Create a unified RunCommand function with Assert()
Remove some run functions and replace them with the unified run command.
Remove DockerCmdWithStdoutStderr
Remove many duplicate runCommand functions.
Also add dockerCmdWithResult()
Allow Result.Assert() to ignore the error message if an exit status is expected.
Fix race in DockerSuite.TestDockerInspectMultipleNetwork
Fix flaky test DockerSuite.TestRunInteractiveWithRestartPolicy

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d7022f2b46589cb9d860219e1d8278351ba147c3
Component: engine
2016-08-23 15:11:46 -04:00
2b0a71c4f1 Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fb42e8477208badf0714a9d8ae20946a9b531dba
Component: engine
2016-08-23 15:11:46 -04:00
57eb7bf948 devmapper: prevent libdevmapper from deleting device symlinks in RemoveDeviceDeferred
if there is no cookie set in dm task, or flag DM_UDEV_DISABLE_LIBRARY_FALLBACK
is cleared for a DM_DEV_REMOVE task, libdevmapper will fallback to clean up the
symlink under /dev/mapper by itself, no matter the device removal is executed
immediately or deferred by the kernel.In some cases, the removal is deferred by the
kernel, while the symlink is deleted directly by libdevmapper, when docker tries to
activate the device again, the deferred removal will be canceld, but the symlink will
not show up again, so docker's attempt to mount the device by the symlink will fail,
and it will eventually leads to a `docker start/diff` error.

Fixes #24671

Signed-off-by: Ji.Zhilong <zhilongji@gmail.com>
Upstream-commit: 5e505d101f0201a4d045510d0a9b0c66697dedfe
Component: engine
2016-08-23 23:58:53 +08:00
cb628977aa Add spec file support for Windows plugin discovery.
Plugin discovery on Windows is not possible using named pipes. However,
it is possible using spec file (tcp based). This adds Windows specific
paths for discovery.

Fixes #23605

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 36cf93fb0c45ce62b3cb1e82e1ecae1486017c9b
Component: engine
2016-08-22 09:14:57 -07:00
4467c80b95 Use real chroot if daemon is running in a user namespace
The namespace unshare+pivot root is not possible when running inside a
user namespace, so fallback to the original "real" chroot code.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: dc950567c105153c0a2f8b40d16b989bbddcdb3c
Component: engine
2016-08-12 16:31:01 -04:00
cc5b6aa3dd Don't create devices if in a user namespace
If we are running in a user namespace, don't try to mknod as
it won't be allowed.  libcontainer will bind-mount the host's
devices over files in the container anyway, so it's not needed.

The chrootarchive package does a chroot (without mounting /proc) before
its work, so we cannot check /proc/self/uid_map when we need to.  So
compute it in advance and pass it along with the tar options.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Upstream-commit: 617c352e9225b1d598e893aa5f89a8863808e4f2
Component: engine
2016-08-12 16:26:58 -04:00
cde4831d1f Merge pull request #24717 from icaoweiwei/patch_2016-07-16_1
Add output of integer argument
Upstream-commit: 2c50035f93ec580fb1b901a2c99a2f95f525a796
Component: engine
2016-08-12 10:54:01 -07:00
8e29f88e6f Merge pull request #25568 from thaJeztah/enhance-string-truncate
Implement stringutils.Ellipsis()
Upstream-commit: 64f83cee43c6fc0785e2beeacc6432572130714b
Component: engine
2016-08-12 17:19:50 +02:00
2e55ebe213 Merge pull request #25561 from allencloud/make-more-pkgs-support-darwin
make more pkgs support darwin
Upstream-commit: 3011a41d3f3b525574407493696ea2391ecc0ff6
Component: engine
2016-08-11 14:17:57 -07:00
60e441e430 Implement stringutils.Ellipsis()
This patch implements an Ellipsis utility to
append an ellipsis (...)  when truncating
strings in output.

It also fixes the existing Truncate() utility
to be compatible with unicode/multibyte characters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 51dc35cf23a5418e93128854bedc2e59d8ca743a
Component: engine
2016-08-11 14:14:06 +02:00
cb1c855c27 Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
Upstream-commit: 64605d709f9bf5677d513d6ed78d63fffadc697d
Component: engine
2016-08-10 11:07:15 -07:00
ba822f35dd make more pkgs support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: bd11a269bc114334cf6160ba38e396f8f0e3aecd
Component: engine
2016-08-10 22:56:05 +08:00
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
b9dc82dd29 Merge pull request #25415 from avaid96/exitret
added functionality to interrupt the terminal when it is waiting for …
Upstream-commit: 91853e44aeb20e55bcfcad5041c274783fdc06bc
Component: engine
2016-08-09 16:47:54 +02:00
44fa57fb1b Merge pull request #22770 from twistlock/22729_dynamic_authz_reload
Enable to dynamically reload authorization plugins via daemon.config
Upstream-commit: b2b3cb7be92b97150c9be96c606c0ab0a383d2ec
Component: engine
2016-08-05 19:38:40 +02:00
a8be04ca52 added functionality to interrupt the terminal when it is waiting for an input
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
Upstream-commit: c4b07f468388af6483913762d6ce6ae2ac9edf97
Component: engine
2016-08-04 10:00:02 -07:00
e730a09366 Merge pull request #23497 from shishir-a412ed/dm_task_run_failed
Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Upstream-commit: 87e48ecd048c0b083fe09fb8d74c83364abd41e6
Component: engine
2016-08-03 21:54:33 +02:00
6d26e235fc Merge pull request #25105 from hqhq/fix_kmem_test
Fix TestUpdateKernelMemoryUninitialized on new kernel version
Upstream-commit: b47df1ddbe847bdffccb76239e3288d59b69cb3b
Component: engine
2016-08-02 17:15:53 +02:00
1e0e8f732e Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Problem Description:

An example scenario that involves deferred removal
1. A new base image gets created (e.g. 'docker load -i'). The base device is activated and
mounted at some point in time during image creation.
2. While image creation is in progress, a privileged container is started
from another image and the host's mount name space is shared with this
container ('docker run --privileged -v /:/host').
3. Image creation completes and the base device gets unmounted. However,
as the privileged container still holds a reference on the base image
mount point, the base device cannot be removed right away. So it gets
flagged for deferred removal.
4. Next, the privileged container terminates and thus its reference to the
base image mount point gets released. The base device (which is flagged
for deferred removal) may now be cleaned up by the device-mapper. This
opens up an opportunity for a race between a 'kworker' thread (executing
the do_deferred_remove() function) and the Docker daemon (executing the
CreateSnapDevice() function).

This PR cancel the deferred removal, if the device is marked for it. And reschedule the
deferred removal later after the device is resumed successfully.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 0e633ee14aca32480ac4735675222c35f4e11d8c
Component: engine
2016-08-02 10:33:58 -04:00
5ef37313b9 Fix TestUpdateKernelMemoryUninitialized on new kernel version
Fixes: #25073

Update kernel memory on running containers without initialized
is forbidden only on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: da5d66fb70064b093f73cc31eddb7e8285048161
Component: engine
2016-08-02 13:17:20 +08:00
5bb33260e8 Revert "Add checking err for IsWindowsClient()"
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: d0b9c33f71f1e87e2236f1f9894ce28827791a7a
Component: engine
2016-08-01 17:33:41 -07:00
f1f1cf0467 Merge pull request #25294 from klinden/patch-1
adding entry for Hugh Beaver
Upstream-commit: f2fb28cbb3f32b6ffec209dd4452b126f769f2ef
Component: engine
2016-08-02 01:01:13 +02:00
d1166d12d4 Add entries for Hugh Beaver, Lois Haibt and some more adjectives
Signed-off-by: Kyle Linden <kyle.linden@appliedis.com>
Upstream-commit: 653d083c1e887617f87d89a128d1398b90e0dd50
Component: engine
2016-08-01 16:05:27 -04:00
25dfa2b9fa Merge pull request #24821 from thaJeztah/stringid-refactor
Minor refactor and beter coverage for pkg/stringid
Upstream-commit: d2eb5dc9e0365ea4d50076011a7ef92d435b5032
Component: engine
2016-08-01 21:12:14 +02:00
c8468e1fc2 make pkg pidfile support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a91f59d4873e9866928261ad62ebcea3ef7add5f
Component: engine
2016-08-01 22:01:20 +08:00
e8a4996d93 Merge pull request #25066 from lixiaobing10051267/masterErr
Add checking err for IsWindowsClient()
Upstream-commit: 4554e6065100d493dd9cd2935901b8532a0dc504
Component: engine
2016-07-30 17:25:08 +01:00
565fab494f Enable to dynamically reload authorization plugins via daemon.config
Following #22729, enable to dynamically reload/remove the daemon
authorization plugins (via standard reloading mechanism).
https://docs.docker.com/engine/reference/commandline/daemon/#daemon-
configuration-file

Daemon must store a reference to the authorization middleware to refresh
the plugin on configuration changes.

Signed-off-by: Liron Levin <liron@twistlock.com>
Upstream-commit: 4192fe9c06d150fadfe18f228a6f9c3875227b8a
Component: engine
2016-07-30 14:59:07 +03:00
74764063d5 Merge pull request #24081 from Microsoft/jjh/signaltofile
Windows: Stack dump to file
Upstream-commit: 1e6fd0378b431425180bad9fe2c38b296c1bc5bf
Component: engine
2016-07-29 22:09:35 +02:00
488d786bb3 Merge pull request #24745 from daehyeok/logrus
Refactoring for logrus formatting
Upstream-commit: 170abb5f7cabf4921a378d76532e74a272fbe39c
Component: engine
2016-07-28 16:50:19 -07:00
e9800c4e43 Modify func name from TestChtimes to TestChtimesLinux
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Modify func note

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 1df9f0932e50ae497a6c79fc3a0ee85cb67f60d4
Component: engine
2016-07-27 10:05:59 +08:00
0a12b515a3 Merge pull request #25086 from dmcgowan/overlay2-fix-sub-directory-whiteouts
Fix overlay2 sub directory whiteouts
Upstream-commit: bb27d017f395d5683d0f82a203038c3055be91d8
Component: engine
2016-07-26 20:45:41 -04:00
5b655758f7 Fix files in subdirectories creating bad whiteout
Closes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 1c0f6653ba82c933885719478e90c13f8d7e32b7
Component: engine
2016-07-26 12:03:55 -07:00
a35fb01dfe add to check err
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: b4833e3b3d683242c016e64d8de7385fcb4c8932
Component: engine
2016-07-26 21:43:32 +08:00
ac18bf29a1 Fix pkg/plugins TLSConfig panic
Fix #25046

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: b1e71bdd1d624e297509a62b072082524dc841fc
Component: engine
2016-07-26 08:53:54 +00:00
b6548fce21 Merge pull request #24961 from jstarks/vt_th2_fix
Windows: Restore console mode on set mode failure
Upstream-commit: bff9a0556f785b094b55fcc9c1e5f83cf74a9aaa
Component: engine
2016-07-25 09:49:34 +02:00
d204454a26 Merge pull request #24977 from lixiaobing10051267/masterNote
Modify several fun notes in fsnotify.go
Upstream-commit: 1f3b400d3c92657a915610a3702cdf4012beffbd
Component: engine
2016-07-25 09:41:17 +02:00
8e3d8789cb Merge pull request #24963 from allencloud/fix-typos
fix typos
Upstream-commit: 40044cb18fd4ff0ed13d8cdd41ec4dcecdac0703
Component: engine
2016-07-25 09:39:48 +02:00