Commit graph

2296 commits

Author SHA1 Message Date
Doug Davis
ff42a2eb41 Only show global warnings once
Upon each container create I'm seeing these warning **every** time in the
daemon output:
```
WARN[0002] Your kernel does not support swap memory limit
WARN[0002] Your kernel does not support cgroup rt period
WARN[0002] Your kernel does not support cgroup rt runtime
```
Showing them for each container.create() fills up the logs and encourages
people to ignore the output being generated - which means its less likely
they'll see real issues when they happen.  In short, I don't think we
need to show these warnings more than once, so let's only show these
warnings at daemon start-up time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-11-30 10:11:42 -08:00
Xianglin Gao
2ab8f2e389 fix apparmor load profile
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
2016-11-29 15:48:38 +08:00
Sebastiaan van Stijn
169b4d92a1
Add some adjectives to the namesgenerator
Because .. `hardcore_hamilton` and `inspiring_murdock`

https://twitter.com/swiftonsecurity/status/801195049165799424

Also replacing adjectives that could be interpreted as
refering to body size, (mental) health, intoxication.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-11-24 18:38:04 +01:00
Tõnis Tiigi
5c1826ec4d Merge pull request #28683 from darrenstahlmsft/SystemDLL
Swap usage of LazyDLL and LoadDLL to LazySystemDLL
2016-11-22 16:58:30 -08:00
Darren Stahl
22c83c567f Swap usage of LazyDLL and LoadDLL to LazySystemDLL.
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-22 14:57:11 -08:00
Sebastiaan van Stijn
313502488e Merge pull request #28506 from bfirsh/prepare-api-docs-for-swagger-docs
Prepare docs and Swagger definition for automatically generated API docs
2016-11-22 22:47:38 +01:00
Sebastiaan van Stijn
86eae4018a Merge pull request #28698 from YuPengZTE/devErrot
error strings should not be capitalized or end with punctuation
2016-11-22 21:25:09 +01:00
Tibor Vass
677e14643c Merge pull request #28595 from anusha-ragunathan/plugin_timeout
Allow HTTP client timeout to be configurable on plugin enable.
2016-11-22 10:17:10 -08:00
Ben Firshman
f0d55cd081
Rename Remote API to Engine API
Implementation of https://github.com/docker/docker/issues/28319

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-11-22 12:49:38 +00:00
yupeng
fc11efa2db error strings should not be capitalized or end with punctuation
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-22 14:53:11 +08:00
yupeng
1e65db4206 First header should be a top level header
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-22 09:33:21 +08:00
Anusha Ragunathan
83ca993c15 Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-21 13:11:40 -08:00
Doug Davis
96f50e9b70 Merge pull request #28611 from vieux/fix_golint
fix a few golint errors
2016-11-19 07:16:44 -05:00
Victor Vieux
9c559e6d0b fix a few golint errors
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 18:32:02 -08:00
Victor Vieux
79a891efb7 skip api/types/container/ (like golint) and fix one pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 16:33:50 -08:00
allencloud
1f039a66ac fix typo
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-11-18 15:51:36 +08:00
Tom Wilkie
3a05545851 s/bCap/bLen/
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2016-11-17 21:05:09 +00:00
Tom Wilkie
158bb9bbd5 Fix use of cap in MultiReadSeeker
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2016-11-17 18:36:35 +00:00
Brian Goff
0bd720b28d Move stack dump dir to exec root
Dump stack dumps to exec root instead of daemon root.
When no path is provided to the stack dumper, such is the case with
SIGQUIT, dump to stderr.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-16 12:55:18 -05:00
John Howard
7c29f5beed Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-14 17:41:52 -08:00
Vincent Demeester
21051de6e1 Merge pull request #28365 from wefine/fix-t-errorf
fix t.Errorf to t.Error in serveral _test.go
2016-11-14 14:46:30 +01:00
wefine
f78f7de96a fix t.Errorf to t.Error in serveral _test.go
Signed-off-by: wefine <wang.xiaoren@zte.com.cn>
2016-11-14 17:54:43 +08:00
Shayne Wang
63904eb674 Change reading order of tailfile
change reading order from beginning at the end to beginning at a buffer start
added intergration tests for boundary cases
Removed whitespace
Signed-off-by: Shayne Wang <shaynexwang@gmail.com>
2016-11-13 20:08:51 -08:00
Ian Campbell
3c233b13a0 pkg/jsonmessage: Encode ANSI ESC directly as \x1b rather than via fmt as %c
This seems clearer to me and avoids a miniscule amount of string formatting.

I have deliberately not changed the tests here to avoid the possibility of
changing both wrongly.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-11-11 11:42:38 +00:00
Ian Campbell
f02221a794 pkg/jsonmessage: Use terminfo rather than open coding ANSI escape codes
Although our use of ANSI codes here is rather simple it is generally good
practice to use terminfo in order to be portable to different terminal
emulators.

Vendor github.com/Nvveen/Gotty (actually my fork with a fix, see
https://github.com/Nvveen/Gotty/pull/1) and use that to parse the terminfo
files.

Note that "\e]2K" (clear entire line) is not covered by terminfo. We can
achieve the same end by first clearing from begining of line to cursor
(el1="\e]1K") and then clearing from cursor to end of line (el="\e]k").

Test suite has been updated and forces (either directly or by setting $TERM to
something highly unlikely to exist) the use of the non-terminfo fallbacks which
retains the same output behaviour as previously. This is preferable even to
relying on a well-known and relatively static terminfo (like vt102) since even
that in principal might have different terminfo encodings.

In case terminfo is not available at all for $TERM or doesn't expose the
specific capabilities which we use then fall back to the previous manual
escapes, with the exception that we avoid "\e]2K" as discussed above.

Tested with a manual docker pull with rxvt-unicode ($TERM=rxvt-unicode), xterm
($TERM=xterm), mlterm ($TERM=mlterm) and aterm ($TERM=kterm).

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-11-11 11:40:53 +00:00
Ian Campbell
2e3baa98eb pkg/jsonmessage: Wrap test failure messages so control characters align
When logging the failure of a case which involves control characters add line
feeds and spacing such that the expected and actual strings are aligned in the
same columns making comparisons easier.

Turns:
	jsonmessage_test.go:156: Expected "\x1b[2K\rstatus      1 B\r", got "\x1b[1K\x1b[K\rstatus      1 B\r"
Into:
	jsonmessage_test.go:156:
		Expected "\x1b[2K\rstatus      1 B\r"
		     got "\x1b[1K\x1b[K\rstatus      1 B\r"

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-11-11 11:40:11 +00:00
Ian Campbell
6582cfb1d4 pkg/jsonmessage: Format all test expected/actual strings with %q
The majority already did so, but a few used %v.

Compared with %v using %q escapes any control characters ensuring they are
visible in the logs (otherwise they can cause scrolling and overwriting etc).

The %q formatter also includes the surrounding "s making the manual use of []
to wrap/delimit the %v output unnecessary.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-11-11 11:39:05 +00:00
John Howard
46ec4c1ae2 Windows: create daemon root with ACL
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-10 17:51:28 -08:00
Tõnis Tiigi
7aeacd35f2 Merge pull request #28238 from ijc25/jsonmessage-urxvt-corruption
pkg/jsonmessage: Avoid undefined ANSI escape codes.
2016-11-10 17:07:01 -08:00
Ian Campbell
b08b437acc pkg/jsonmessage: Avoid undefined ANSI escape codes.
The ANSI escape codes \e[0A (cursor up 0 lines) and \e[0B (cursor down 0 lines)
are not well defined and are treated differently by different terminals. In
particular xterm treats 0 as a missing parameter and therefore defaults to 1,
whereas rxvt-unicode treats these escapes as a request to move 0 lines.

However the use of these codes is unnecessary and were really just hiding the
fact that we were not correctly computing diff when adding a new line. Having
added the new line to the ids map and output the corresponding \n we need to
then calculate a correct diff of 1 rather than leaving it as the default 0
(which xterm then interprets as 1). The fix is to pull the diff calculation out
of the else case and to always do it.

With this in place we can then avoid outputting escapes for moving 0 lines.
Actually diff should never be 0 to start with any more, but check to be safe.

This fixes corruption of `docker pull` seen with rxvt-unicode (and likely other
terminals in that family) seen in #28111. Tested with rxvt-unicode
($TERM=rxvt-unicode), xterm ($TERM=xterm), mlterm ($TERM=mlterm) and aterm
($TERM=kterm).

The test cases have been updated to match the new behaviour.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-11-10 14:10:47 +00:00
Victor Vieux
643ac2f804 Merge pull request #27433 from AkihiroSuda/fix-ovl-xfs-ftype0
overlay: warn if overlay backing fs doesn't support d_type
2016-11-09 13:39:07 -08:00
Michael Crosby
da0ccf8e61 Merge pull request #28047 from cpuguy83/27773_chrootarchive_rbind
Fix issue with cp to container volume dir
2016-11-09 10:52:14 -08:00
Akihiro Suda
2e20e63da2 overlay: warn if overlay backing fs doesn't support d_type
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-11-09 07:18:27 +00:00
John Howard
54e09aa4e2 Windows: Avoid concurrent access to sysinfo
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-08 17:52:38 -08:00
Vincent Demeester
acf7ce1aa0
Remove use of pkg/integration in pkg/idtools
This remove a dependency on `go-check` (and more) when using
`pkg/idtools`. `pkg/integration` should never be called from any other
package then `integration`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-08 17:21:02 +01:00
Amit Krishnan
934328d8ea Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-07 09:06:34 -08:00
Alexander Morozov
c072347078 Merge pull request #27912 from LK4D4/vndr
project: use vndr for vendoring
2016-11-03 18:30:19 -07:00
Riyaz Faizullabhoy
a64fc8eea3 Revert "Update authz plugin list on failure."
This reverts commit fae904af02.

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-11-03 15:49:21 -07:00
Alexander Morozov
f2614f2107 project: use vndr for vendoring
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-03 15:31:46 -07:00
Brian Goff
02bc2e652b Merge pull request #27331 from Microsoft/jjh/spew
Add spew debugging
2016-11-03 16:36:20 -04:00
Sebastiaan van Stijn
16f6b3e8a9 Merge pull request #27383 from runcom/authz-peercerts
pkg/authorization: send request's TLS peer certificates to plugins
2016-11-03 13:22:29 -07:00
Brian Goff
e6eef7eb49 Fix issue with cp to container volume dir
In some cases, attempting to `docker cp` to a container's volume dir
would fail due to the volume mounts not existing after performing a
bind-mount on the container path prior to doing a pivot_root.

This does not seem to be effecting all systems, but was found to be a
problem on centos.
The solution is to use an `rbind` rather than `bind` so that any
existing mounts are carried over.

The `MakePrivate` on `path` is no longer neccessary since we are already
doing `MakeRPrivate` on `/`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-03 16:01:15 -04:00
John Howard
4c62b12636 Spew debugging
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-03 10:05:11 -07:00
Harry Zhang
390fe752a2 return when error happens on listener close
Signed-off-by: Harry Zhang <harryz@hyper.sh>
2016-11-03 23:13:24 +08:00
Justin Cormack
81683e898a Merge pull request #27599 from estesp/getent-path
Add support for looking up user/groups via `getent`
2016-11-03 15:11:42 +00:00
Vincent Demeester
19b5b4aada Merge pull request #27951 from LK4D4/dump_always_to_file
daemon: always dump stack to file
2016-11-03 00:35:06 -07:00
Tibor Vass
1e51f99684 Merge pull request #27918 from dmcgowan/use-system-certs
Merge system certificate pool with custom certificates
2016-11-02 13:51:58 -07:00
Alexander Morozov
e5d36586ac daemon: always dump stack to file
Dumping to log is unusable in 90% of cases and inspecting file is much
more convenient.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-02 11:22:43 -07:00
Vincent Demeester
bcdce2a6b0 Merge pull request #27705 from dmcgowan/fix-27298
Ensure opaque directory permissions respected
2016-11-02 10:13:30 +01:00
Daehyeok Mun
fa710e504b Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

Fixed issue #23459

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-10-31 22:05:01 -06:00
Derek McGowan
66a5e34cc4
Use system ca pool from tlsconfig
Remove deprecated config from local pkg/tlsconfig.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-10-31 14:52:07 -07:00
Antonio Murdaca
1452c1cc71
pkg/authorization: send request's TLS peer certificates to plugins
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-31 17:37:19 +01:00
Qiang Huang
e6866492c4 Fix bunch of typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-29 15:03:26 +08:00
Phil Estes
6cb8392be9 Add support for looking up user/groups via getent
When processing the --userns-remap flag, add the
capability to call out to `getent` if the user and
group information is not found via local file
parsing code already in libcontainer/user.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-10-28 19:06:07 -04:00
Anusha Ragunathan
406c19f096 Merge pull request #27804 from anusha-ragunathan/blacklist-authz
Blacklist authz plugins that failed.
2016-10-28 15:06:20 -07:00
Derek McGowan
daa7019517
Ensure opaque directory permissions respected
When converting an opaque directory always keep the original
directory tar entry to ensure directory is created with correct
permissions on restore.

Closes #27298

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-10-28 13:13:10 -07:00
Anusha Ragunathan
fae904af02 Update authz plugin list on failure.
When daemon fails to load an authz plugin, it should be removed from
the plugin list. Else the plugin is retried on every request and
response, resulting in undesired behavior (eg. daemon panic)

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-28 11:16:06 -07:00
Erik Hollensbe
c4be1b117f stdcopy: remove logrus debug messages; makes it easier to vendor without the dependency.
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2016-10-26 16:29:37 -07:00
Erik St. Martin
56f77d5ade Implementing support for --cpu-rt-period and --cpu-rt-runtime so that
containers may specify these cgroup values at runtime. This will allow
processes to change their priority to real-time within the container
when CONFIG_RT_GROUP_SCHED is enabled in the kernel. See #22380.

Also added sanity checks for the new --cpu-rt-runtime and --cpu-rt-period
flags to ensure that that the kernel supports these features and that
runtime is not greater than period.

Daemon will support a --cpu-rt-runtime flag to initialize the parent
cgroup on startup, this prevents the administrator from alotting runtime
to docker after each restart.

There are additional checks that could be added but maybe too far? Check
parent cgroups to ensure values are <= parent, inspecting rtprio ulimit
and issuing a warning.

Signed-off-by: Erik St. Martin <alakriti@gmail.com>
2016-10-26 11:33:06 -04:00
John Howard
ff6db320f8 Merge pull request #27747 from Microsoft/jjh/clientisolationcomment
Windows: Add comment for containers on client SKUs
2016-10-25 13:37:25 -07:00
John Howard
87ab13add4 Windows: Add comment re client containers
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-25 10:30:00 -07:00
John Howard
745f3ece53 mkdirall on the PID file path
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-25 09:11:20 -07:00
Kenfe-Mickaël Laventure
87ae571fed Merge pull request #27609 from tonistiigi/fix-chroot-shared-parent
chroot: remount everything as private in new mntns
2016-10-21 14:40:40 -07:00
Victor Vieux
d0e6dae233 Merge pull request #27522 from vieux/data_race_plugins
prevent data race in pkg/plugins
2016-10-21 14:19:48 -07:00
Victor Vieux
f7af80860c prevent data race in pkg/plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-21 13:28:13 -07:00
Aaron Lehmann
bc52939b04 Merge pull request #27613 from stevvooe/archive-package-cleanup
pkg/archive: remove unnecessary Archive and Reader type
2016-10-20 20:56:23 -07:00
Stephen J Day
aa2cc18745
pkg/archive: remove unnecessary Archive and Reader type
The `archive` package defines aliases for `io.ReadCloser` and
`io.Reader`. These don't seem to provide an benefit other than type
decoration. Per this change, several unnecessary type cases were
removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-10-20 19:31:24 -07:00
Aaron Lehmann
2e742b0221 Merge pull request #27606 from stevvooe/no-pool-pointer
pkg/pool: no need for double pointer for sync.Pool
2016-10-20 17:03:41 -07:00
Tonis Tiigi
70dfea63ba chroot: let root be cleaned up by kernel
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-20 15:50:46 -07:00
Tonis Tiigi
b511d1f0ca chroot: remount everything as private in new mntns
If parent of the destination path is shared, this
path will be unmounted from the parent ns even if
the path itself is private.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-20 15:29:23 -07:00
Stephen J Day
836f347cb0
pkg/pool: no need for double pointer for sync.Pool
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-10-20 15:27:38 -07:00
Aaron Lehmann
2c620d0aa2 Merge pull request #27287 from mavenugo/pluginv2-sk2
Allow multiple handlers to support network plugins in swarm-mode
2016-10-20 13:43:04 -07:00
YuPengZTE
fa378413f8 Fix the typo of URLs
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-10-19 17:46:27 +08:00
Sebastiaan van Stijn
194f04bbbe Merge pull request #27267 from ezrasilvera/plugin_fix
Call the AuthZRes function also when the daemon  returns error
2016-10-18 21:53:43 -07:00
Madhu Venugopal
5e9c78aeaf Allow plugins to have multiple handlers
Currently the plugins pkg allows a single handler. This assumption
breaks down if there are mutiple listeners to a plugin of a certain
Manifest such as NetworkDriver or IpamDriver when swarm-mode is enabled.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-17 09:00:17 -07:00
Akihiro Suda
3a32b58792 Fix broken JSON support in cli/command/formatter
How to test:

    $ docker ps --format '{{json .}}'
    $ docker network ls --format '{{json .}}'
    $ docker volume ls --format '{{json .}}'

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-10-17 08:07:17 +00:00
Sebastiaan van Stijn
21a79b503a Merge pull request #27366 from morelena/use_contains
all: use strings.Contains instead Index
2016-10-13 18:44:30 -07:00
Elena Morozova
a37027f6bd all: use strings.Contains instead Index
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 15:55:41 -07:00
Aaron Lehmann
245bd4c3d2 Merge pull request #27365 from morelena/remove_nil_check
all: remove nil check for slices
2016-10-13 15:27:37 -07:00
Elena Morozova
ace53bbe65 all: remove nil check for slices
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 13:55:38 -07:00
Elena Morozova
64238fef8c all: replace loop with single append
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 13:31:52 -07:00
Tibor Vass
8658748ef7 Merge pull request #27293 from anusha-ragunathan/use-pluginv2-authz
Make authz use pluginv2
2016-10-13 00:28:43 +02:00
Alexander Morozov
a616cf3b88 pkg/authorization: make it goroutine-safe
It was racy on config reload

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-10-11 16:31:45 -07:00
Anusha Ragunathan
c5393ee147 Make authorization plugins use pluginv2.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-11 13:09:28 -07:00
Ezra Silvera
5a8ff40254 Call the AuthZRes function also when the daemon returns error
Signed-off-by: Ezra Silvera <ezra@il.ibm.com>
2016-10-11 09:53:30 +03:00
Tonis Tiigi
797f630d2e Reduce TestRunCommandWithTimeoutKilled flakiness
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-10 17:31:37 -07:00
Lei Jitang
6514299fa9 pkg/archive/changes_posix_test.go: un-comment code line "defer os.RemoveAll(src)"
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-10-10 05:23:24 -04:00
Justin Cormack
5ee2c2a647 Merge pull request #27160 from mlaventure/update-containerd
Update containerd and runc
2016-10-06 19:36:31 +02:00
Kenfe-Mickael Laventure
7e12c3bb99 Update containerd and runc
containerd: 837e8c5e1cad013ed57f5c2090c8591c10cbbdae
runc: 02f8fa7863dd3f82909a73e2061897828460d52f

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-05 14:47:15 -07:00
Josh Wilson
c0a5772668 Force input stream ANSI emulation for ConsoleZ
This performs a similar check to the `"ConEmuANSI"` check that was recently
added to enable arrow keys navigation in docker container terminals.

Signed-off-by: Josh Wilson <josh.wilson@fivestars.com>
2016-10-05 12:42:48 -07:00
Anusha Ragunathan
d599d53db2 Add plugingetter to pkg.
plugingetter is indepedent of docker/docker packages, so it can be
moved to pkg. This is also necessary for authorization plugins (part of
pkg) to use pluginv2. The original path at plugin/getter will be
eventually removed, when external repos (eg. libnetwork) update their
import paths.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-04 12:03:29 -07:00
Tonis Tiigi
57e12037ac Fix error reporting in CopyFileWithTar
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-30 11:46:37 -07:00
Christopher Jones
1a702111c6
Fix apparmor profile installation
Fixes #26823

Fixes an issue where apparmor was not loaded into the kernel, because
apparmor_parser was being called incorrectly.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-09-29 18:47:20 -05:00
Anusha Ragunathan
af2e256249 Return pipeline errors correctly.
To use a deferred func to overwrite the returned error requires using
the 'named' error. So reuse err, instead of pipelineError. Also, the old
pipelineError will never be nil, since its executed before the error can
be set.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-23 13:09:56 -07:00
Anusha Ragunathan
fefea805e9 Make graphdrivers work with pluginv2.
As part of making graphdrivers support pluginv2, a PluginGetter
interface was necessary for cleaner separation and avoiding import
cycles.

This commit creates a PluginGetter interface and makes pluginStore
implement it. Then the pluginStore object is created in the daemon
(rather than by the plugin manager) and passed to plugin init as
well as to the different subsystems (eg. graphdrivers, volumedrivers).
A side effect of this change was that some code was moved out of
experimental. This is good, since plugin support will be stable soon.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-20 08:49:48 -07:00
Vincent Demeester
7a86930c74 Merge pull request #26436 from stevvooe/remove-transport-package
client: remove transport package
2016-09-20 16:43:56 +02:00
Antonio Murdaca
5c35bfed3f
Revert "Add default timeout to pkg/plugins/client"
This reverts commit 0699b00d26.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-20 10:01:03 +02:00
John Howard
56952e2159 Merge pull request #26662 from WeiZhang555/fix-flaky-unit-test
Fix flaky unit test
2016-09-17 18:32:11 -07:00
John Howard
4a0419f536 Merge pull request #25737 from Microsoft/jjh-statistics
Windows: Add support for docker stats
2016-09-17 09:31:24 -07:00
Zhang Wei
bc5768733d Fix flaky unit test
Fix flaky test `TestHTTPTimeout` caused by precision problem.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-17 19:40:58 +08:00
John Howard
340e5233b2 Windows: stats support
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 11:56:15 -07:00
Aaron Lehmann
a1fc3852da Merge pull request #26512 from AkihiroSuda/fix-pkg-plugins-racy-test
[test] fix racy test in pkg/plugins
2016-09-15 20:11:03 -07:00
Akihiro Suda
4bc908ec89 fix racy test in pkg/plugins
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-16 01:43:35 +00:00
Alexander Morozov
b2263c111f Merge pull request #26511 from AkihiroSuda/fix-pkg-archive-racy-test
[test] fix racy tests in pkg/archive
2016-09-15 11:10:34 -07:00
Aaron Lehmann
f8eab6fea8 progress: Rate limit progress bar output
ProgressReader outputs progress information every 500 KB. This could be
excessive if something is being transfered at a fast rate. Rate-limit
progress output to 10 per second.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-09-14 17:23:16 -07:00
Akihiro Suda
62cbd2589f fix racy tests in pkg/archive
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-14 04:17:23 +00:00
Vincent Demeester
675144ff8d Merge pull request #26514 from AkihiroSuda/fix-pkg-integration-race
[test] fix races in pkg/integration/cmd
2016-09-13 15:18:41 +02:00
Aleksa Sarai
2f7596aaef
apparmor: do not save profile to /etc/apparmor.d
Writing the profile to /etc/apparmor.d, while also manually loading it
into the kernel results in quite a bit of confusion. In addition, it
means that people using apparmor but have /etc mounted read-only cannot
use apparmor at all on a Docker host.

Fix this by writing the profile to a temporary directory and deleting it
after it's been inserted.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-09-13 16:25:16 +10:00
Akihiro Suda
e17f77ec51 fix races in pkg/integration/cmd
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-13 04:23:36 +00:00
Chun Chen
0699b00d26 Add default timeout to pkg/plugins/client
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-09-12 10:39:32 +08:00
Stephen J Day
9d7be9df8f tlsconfig: move Clone into proper package
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-09 12:05:17 -07:00
Michael Crosby
c1f2776bf1 Merge pull request #26428 from darrenstahlmsft/AddToSymlink
Don't attempt to evaluate drive root on Windows
2016-09-09 09:09:24 -07:00
Darren Stahl
fdce2a7775 Don't attempt to evaluate drive root on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-08 13:52:54 -07:00
Daniel Nephin
9c2b935812 Replace api/client imports with cli/command in experimental files.
Using

git grep -l 'client\.DockerCli' cli/command/stack/ | xargs sed -i -e 's/client\.DockerCli/command\.Dockercli/g'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:46:48 -04:00
Alexander Morozov
d959e7fac4 Merge pull request #26107 from dnephin/client_cleanup
Shrink the DockerCLI type
2016-09-08 12:18:46 -07:00
Aaron Lehmann
bc06542a17 Merge pull request #25523 from dmcgowan/fsync-layer-filestore
Update layer store to sync transaction files before committing
2016-09-08 10:03:12 -07:00
Daniel Nephin
a0ab33124a Extract stream output handling to a new type.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 12:33:41 -04:00
Brian Goff
28d18b8205 Merge pull request #25578 from rwilliams/conemu
Force input stream ANSI emulation for ConEmu.
2016-09-08 11:12:33 -04:00
Brian Goff
2381c7f18d Merge pull request #26281 from LK4D4/fix_multireader_offset
pkg/ioutils: fix multireader SEEK_CUR branch
2016-09-06 20:47:03 -04:00
Alexander Morozov
f3627c3726 pkg/ioutils: fix multireader SEEK_CUR branch
Before getReaderForOffset returned always nil and wrong offset.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-06 11:08:35 -07:00
Tonis Tiigi
7a8c7b47cf Fix govet for go1.7
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-02 19:07:54 -07:00
Michal Wieczorek
52c0daad82 fix spec file support for Windows plugin discovery (#25903)
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2016-08-26 22:11:58 +02:00
Daniel Nephin
14712f9ff0 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>
2016-08-25 13:09:04 -04:00
Daniel Nephin
7c556849aa Add testutil/tempfile
Improve error messages raised by assert.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:03 -04:00
Vincent Demeester
4d590ba44a Merge pull request #25967 from valgaze/feat/lewin
Add Daniel Lewin to names collection
2016-08-24 20:28:55 +02:00
Vincent Demeester
4a1b048c15 Merge pull request #25959 from estesp/fail-on-graphdir-perms
Don't start daemon in userns mode if graphdir inaccessible
2016-08-24 20:15:58 +02:00
Daniel Nephin
b29558ed5d Merge pull request #25426 from dnephin/better-int-testing-cmd
Remove duplicate RunCommand functions used for integration-cli
2016-08-24 11:34:24 -04:00
Phil Estes
43a1df6be2
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>
2016-08-24 11:25:30 -04:00
Phil Estes
76a416ac37
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>
2016-08-24 11:25:26 -04:00
Victor Algaze
479b793a3e Add Joan Clarke to name collection
Signed-off-by: Victor Algaze <valgaze@gmail.com>
2016-08-24 01:58:48 -07:00
Victor Algaze
bc0e2f1a6e Add Daniel Lewin to names collection
Signed-off-by: Victor Algaze <valgaze@gmail.com>
2016-08-23 23:24:29 -07:00
Yong Tang
9cb8fb6ea0 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>
2016-08-23 21:08:23 -07:00
Brian Goff
8c5c2842ba Merge pull request #25903 from anusha-ragunathan/windows_plugin_spec
Add spec file support for Windows plugin discovery.
2016-08-23 19:45:54 -04:00
Daniel Nephin
243885808f 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>
2016-08-23 15:12:36 -04:00
Daniel Nephin
d7022f2b46 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>
2016-08-23 15:11:46 -04:00
Daniel Nephin
fb42e84772 Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Ji.Zhilong
5e505d101f 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>
2016-08-23 23:58:53 +08:00
Anusha Ragunathan
36cf93fb0c 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>
2016-08-22 09:14:57 -07:00
Phil Estes
dc950567c1 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>
2016-08-12 16:31:01 -04:00
Serge Hallyn
617c352e92 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>
2016-08-12 16:26:58 -04:00
Michael Crosby
2c50035f93 Merge pull request #24717 from icaoweiwei/patch_2016-07-16_1
Add output of integer argument
2016-08-12 10:54:01 -07:00
Vincent Demeester
64f83cee43 Merge pull request #25568 from thaJeztah/enhance-string-truncate
Implement stringutils.Ellipsis()
2016-08-12 17:19:50 +02:00
Michael Crosby
3011a41d3f Merge pull request #25561 from allencloud/make-more-pkgs-support-darwin
make more pkgs support darwin
2016-08-11 14:17:57 -07:00
Sebastiaan van Stijn
51dc35cf23
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>
2016-08-11 14:14:06 +02:00
Ron Williams
0fd4bbda2d Force input stream ANSI emulation for ConEmu.
Signed-off-by: Ron Williams <ron.a.williams@gmail.com>
2016-08-10 11:24:12 -07:00
Alexander Morozov
64605d709f Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
2016-08-10 11:07:15 -07:00
allencloud
bd11a269bc make more pkgs support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 22:56:05 +08:00
allencloud
0ead624473 add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 08:36:09 +08:00
Derek McGowan
c37bd10f8c Update layer store to sync transaction files before committing
Fixes case where shutdown occurs before content is synced to disked
on layer creation. This case can leave the layer store in an bad
state and require manual recovery. This change ensures all files
are synced to disk before a layer is committed. Any shutdown that
occurs will only cause the layer to not show up but will allow it to
be repulled or recreated without error.

Added generic io logic to ioutils package to abstract it out of
the layer store package.


Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2016-08-09 11:55:17 -07:00
Sebastiaan van Stijn
91853e44ae Merge pull request #25415 from avaid96/exitret
added functionality to interrupt the terminal when it is waiting for …
2016-08-09 16:47:54 +02:00