Commit graph

2429 commits

Author SHA1 Message Date
Michael Crosby
17ec46a243 Set OPOST on bsd
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-02 12:53:49 -07:00
Brian Goff
91e0141784 Merge pull request #33485 from tpot/33484-fix-file-perm-octal
Use octal values for file mode in filenotify poller and sysinfo_linux tests
2017-06-02 11:15:42 -04:00
Aaron Lehmann
096eeb3e75 Merge pull request #33479 from vieux/move_multireader
move multireader out of /pkg
2017-06-02 12:04:57 +02:00
Tim Potter
c35ea6b2cd Use octal values for file mode in filenotify poller and sysinfo_linux tests
Closes #33484.

Signed-off-by: Tim Potter <tpot@hpe.com>
2017-06-02 12:27:10 +10:00
Tim Potter
cd457e7885 Fix incorrect assert message in TestReadProcBool
Closes #33480.

Signed-off-by: Tim Potter <tpot@hpe.com>
2017-06-02 10:15:58 +10:00
Victor Vieux
2445e6b99d move multireader out of /pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-06-01 16:22:00 -07:00
Naveed Jamil
4b0df45c1a Add test coverage to pkg/signal
Signed-off-by: Naveed Jamil <naveed.jamil@tenpearls.com>
2017-06-01 14:53:15 +05:00
Raja Sami
bdc87676bf Increase the Coverage of pkg/platform
Signed-off-by: Raja Sami <raja.sami@tenpearls.com>
2017-05-31 13:26:40 +05:00
Darren Stahl
75f7f2a83a Check for Windows 10 IoT Core to use process isolation on IoT
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-30 12:01:38 -07:00
Felix Abecassis
62871ef2fa Do not reuse a http.Request after a failure in callWithRetry
Closes: #33412

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2017-05-26 18:02:31 -07:00
Neil Horman
d764d8b166 Ensure that a device mapper task is referenced until task is complete
DeviceMapper tasks in go use SetFinalizer to clean up C construct
counterparts in the C LVM library.  While thats well and good, it relies
heavily on the exact interpretation of when the golang garbage collector
determines that an object is unreachable is subject to reclaimation.
While common sense would assert that for stack variables (which these DM
tasks always are), are unreachable when the stack frame in which they
are declared returns, thats not the case.  According to this:

https://golang.org/pkg/runtime/#SetFinalizer

The garbage collector decides that, if a function calls into a
systemcall (which task.run() always will in LVM), and there are no
subsequent references to the task variable within that stack frame, then
it can be reclaimed.  Those conditions are met in several devmapper.go
routines, and if the garbage collector runs in the middle of a
deviceMapper operation, then the task can be destroyed while the
operation is in progress, leading to crashes, failed operations and
other unpredictable behavior.

The fix is to use the KeepAlive interface:

https://golang.org/pkg/runtime/#KeepAlive

The KeepAlive method is effectively an empy reference that fools the
garbage collector into thinking that a variable is still reachable.  By
adding a call to KeepAlive in the task.run() method, we can ensure that
the garbage collector won't reclaim a task object until its execution
within the deviceMapper C library is complete.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2017-05-24 11:11:23 -04:00
Sebastiaan van Stijn
dd27bbb41a Merge pull request #33269 from tophj-ibm/switch-more-syscalls-pkg-term
[pkg/term] switch more syscalls to /x/sys/
2017-05-19 02:37:52 +02:00
Sebastiaan van Stijn
6b26257202 Merge pull request #33250 from cyphar/apparmor-readonly-root-fix
apparmor: make pkg/aaparser work on read-only root
2017-05-18 23:17:31 +02:00
Christopher Jones
df6dfcf198
[pkg/term] switch more syscalls to /x/sys/
Switches the remaining syscalls except Errno to /x/sys/.
This was supposed to be part of 33180

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2017-05-18 09:02:42 -04:00
Tibor Vass
6f6ee6fd04 Merge pull request #33180 from tophj-ibm/switch-pkg-term-syscalls-to-x/sys
[pkg/term] refactor and switch syscall to x/sys
2017-05-17 07:41:18 -07:00
Aleksa Sarai
dd340c52cb
apparmor: make pkg/aaparser work on read-only root
This is necessary because normally `apparmor_parser -r` will try to
create a temporary directory on the host (which is not allowed if the
host has a rootfs). However, the -K option bypasses saving things to the
cache (which avoids this issue).

  % apparmor_parser -r /tmp/docker-profile
  mkstemp: Read-only file system
  % apparmor_parser -Kr /tmp/docker-profile
  %

In addition, add extra information to the ensureDefaultAppArmorProfile
errors so that problems like this are easier to debug.

Fixes: 2f7596aaef ("apparmor: do not save profile to /etc/apparmor.d")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-05-18 00:05:13 +10:00
Josh Hawn
4921171587 Update ContainerWait API
This patch adds the untilRemoved option to the ContainerWait API which
allows the client to wait until the container is not only exited but
also removed.

This patch also adds some more CLI integration tests for waiting for a
created container and waiting with the new --until-removed flag.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Handle detach sequence in CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update Container Wait Conditions

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Apply container wait changes to API 1.30

The set of changes to the containerWait API missed the cut for the
Docker 17.05 release (API version 1.29). This patch bumps the version
checks to use 1.30 instead.

This patch also makes a minor update to a testfile which was added to
the builder/dockerfile package.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Remove wait changes from CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address minor nits on wait changes

- Changed the name of the tty Proxy wrapper to `escapeProxy`
- Removed the unnecessary Error() method on container.State
- Fixes a typo in comment (repeated word)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Use router.WithCancel in the containerWait handler

This handler previously added this functionality manually but now uses
the existing wrapper which does it for us.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Add WaitCondition constants to api/types/container

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

- Update ContainerWait backend interface to not return pointer values
  for container.StateStatus type.
- Updated container state's Wait() method comments to clarify that a
  context MUST be used for cancelling the request, setting timeouts,
  and to avoid goroutine leaks.
- Removed unnecessary buffering when making channels in the client's
  ContainerWait methods.
- Renamed result and error channels in client's ContainerWait methods
  to clarify that only a single result or error value would be sent
  on the channel.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Move container.WaitCondition type to separate file

... to avoid conflict with swagger-generated code for API response

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2017-05-16 15:11:39 -07:00
Tõnis Tiigi
ad846a136a Merge pull request #32959 from simonferquel/tar-filemode-windows
Respect tar entries modes when rewriting them on Windows
2017-05-16 11:45:42 -07:00
Christopher Jones
1c94c264c4
Rename term to winsize, tc_other to tc
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2017-05-16 11:46:17 -04:00
Tibor Vass
f8416e82d9 [pkg/term] Refactor BSD-specific files
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-16 10:12:33 -04:00
Christopher Jones
f30b072b81
[pkg/term] switch syscall to x/sys
Switches calls to syscall to x/sys, which is more up to date.
This is fixes a number of possible bugs on other architectures
where ioctl tcget and tcset aren't implemented correctly.

There are a few remaining syscall references, because x/sys doesn't
have an Errno implementation yet.

Also removes a ppc64le and cgo build tag that fixes building on
ppc64le without cgo

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2017-05-15 18:34:41 -04:00
Brian Goff
2c45392b8f Merge pull request #33119 from nhorman/devmapper-fixes
Devmapper fixes for cookie generation and error reporting (fixes  #33050)
2017-05-15 13:18:52 -04:00
Kenfe-Mickaël Laventure
ba52bb0fd1 Merge pull request #32502 from tonistiigi/git-allow-pr-number
Allow specifying any remote ref in git checkout URLs
2017-05-15 09:34:54 -07:00
Ying Li
a771c16834 Update the stream formatter to display custom unit numbers.
Signed-off-by: Ying Li <ying.li@docker.com>
2017-05-11 11:13:11 -07:00
Brian Goff
e8c2a33b74 Merge pull request #33139 from stevvooe/remove-unused-functions
pkg/ioutils: remove unused functions
2017-05-10 16:48:14 -04:00
Brian Goff
a46f7bd5bd Merge pull request #33128 from crosbymichael/update-containerd-2x
Update containerd for terminal updates
2017-05-10 16:45:11 -04:00
Stephen J Day
c546894aef
pkg/ioutils: remove unused functions
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-05-10 08:34:16 -07:00
Brian Goff
815e8bb885 Merge pull request #31012 from cpuguy83/do_not_remove_containers_on_error
Do not remove containers from memory on error
2017-05-10 06:21:28 -04:00
Michael Crosby
270a33b666 Add OPOST back to !cgo build for pkg/term
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-09 16:36:17 -07:00
Akihiro Suda
3d7af24f63 Merge pull request #32145 from ripcurld0/fix_32120
Disable HTML escaping for JSON in formatter
2017-05-10 06:54:56 +09:00
Neil Horman
5206d45e70 Move UdevWait from defer to inline
All LVM actions in the devicemapper library are asyncronous, involving a call to
a task enqueue function (dm_run_task) and a wait on a resultant udev event
(UdevWait).  Currently devmapper.go defers all calls to UdevWait, which discards
the return value.  While it still generates an error message in the log (if
debugging is enabled), the calling thread is still allowed to continue as if no
error has occured, leading to subsequent errors, and significant confusion when
debugging, due to those subsequent errors.  Given that there is no risk of panic
between the task submission and the wait operation, it seems more reasonable to
preform the UdevWait inline at the end of any given lvm action so that errors
can be caught and returned before docker can continue and create additional
failures.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2017-05-09 13:42:04 -04:00
Neil Horman
edd1c9e325 Make cookies for devicemapper operations unique
Currently, the devicemapper library sets cookies to correlate wait operations,
which must be unique (as the lvm2 library doesn't detect duplicate cookies).
The current method for cookie generation is to take the address of a cookie
variable.  However, because the variable is declared on the stack, execution
patterns can lead to the cookie variable being declared at the same stack
location, which results in a high likelyhood of duplicate cookie use, which in
turn can lead to various odd lvm behaviors, which can be hard to track down
(object use before create, duplicate completions, etc).  Lets guarantee that the
cookie we generate is unique by declaring it on the heap instead.  This
guarantees that the address of the variable won't be reused until such time as
the UdevWait operation completes, and drops its reference to it, at which time
the gc can reclaim it.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2017-05-09 13:42:01 -04:00
Neil Horman
547510fb55 Enhance error logging for failed UdevWait operations in devmapper
If a wait event fails when preforming a devicemapper operation, it would be good
to know, in addition to the cookie that its waiting on, we reported the error
that was reported from the lvm2 library.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2017-05-09 13:41:12 -04:00
Boaz Shuster
5766317e33 Disable HTML escaping for JSON in formatter
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-05-09 10:16:10 +03:00
Stephen J Day
66cfe61f71
pkg: remove random package
The unnecessary `random` package has been removed in favor of using the
`math/rand` package directly. Seeding of the random value from crypto
has been added to the `stringid` package to account for the change.

May need to add an equivalent seed to `namesgenerator`, but this is
often used with `stringid` and has collision protection.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-05-08 17:02:02 -07:00
Kenfe-Mickaël Laventure
7238cca42c Merge pull request #33007 from crosbymichael/containerd-rc5
Update moby to containerd and runc 1.0 final rc
2017-05-08 09:23:07 -07:00
Brian Goff
54dcbab25e Do not remove containers from memory on error
Before this, if `forceRemove` is set the container data will be removed
no matter what, including if there are issues with removing container
on-disk state (rw layer, container root).

In practice this causes a lot of issues with leaked data sitting on
disk that users are not able to clean up themselves.
This is particularly a problem while the `EBUSY` errors on remove are so
prevalent. So for now let's not keep this behavior.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-05-05 17:02:04 -04:00
Michael Crosby
005506d36c Update moby to runc and oci 1.0 runtime final rc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-05 13:45:45 -07:00
Tibor Vass
71e9f5c520 Prevent ppc64le to build pkg/term without cgo
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-05 12:14:30 -07:00
Ian Campbell
5894bc1abf Add docker build --iidfile=FILE
This is synonymous with `docker run --cidfile=FILE` and writes the digest of
the newly built image to the named file. This is intended to be used by build
systems which want to avoid tagging (perhaps because they are in CI or
otherwise want to avoid fixed names which can clash) by enabling e.g. Makefile
constructs like:

    image.id: Dockerfile
    	docker build --iidfile=image.id .

    do-some-more-stuff: image.id
    	do-stuff-with <image.id

Currently the only way to achieve this is to use `docker build -q` and capture
the stdout, but at the expense of losing the build output.

In non-silent mode (without `-q`) with API >= v1.29 the caller will now see a
`JSONMessage` with the `Aux` field containing a `types.BuildResult` in the
output stream for each image/layer produced during the build, with the final
one being the end product.  Having all of the intermediate images might be
interesting in some cases.

In silent mode (with `-q`) there is no change, on success the only output will
be the resulting image digest as it was previosuly.

There was no wrapper to just output an Aux section without enclosing it in a
Progress, so add one here.

Added some tests to integration cli tests.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-05 16:35:54 +01:00
Tonis Tiigi
493a6c3d41 Allow checking out any ref in gitutils
Also changes so that shallow fetch is performed
even when a specific ref is specified.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-05-04 14:14:50 -07:00
Daniel Nephin
c87d67b0ad Refacator pkg/streamformatter
StreamFormatter suffered was two distinct structs mixed into a single struct
without any overlap.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-02 17:38:12 -04:00
Simon Ferquel
41eb61d5c2 Respect tar entries modes when rewriting them on Windows
Previously, only perm-related bits where preserved when rewriting
FileMode in tar entries on Windows. This had the nasty side effect of
having tarsum returning different values when executing from a tar filed
produced on Windows or Linux.

This fix the issue, and pave the way for incremental build context
to work in hybrid contexts.

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-05-02 11:36:43 +02:00
Brian Goff
ccc1324b59 Merge pull request #31391 from cpuguy83/fix_volume_unmount_disconnected_fs
Use lazy unmount for local volume driver unmount
2017-04-27 16:22:58 -04:00
Michael Crosby
169c013911 Don't error with empty group
Don't error if no group is specified, as this was the prior API.  Also
don't return a docker specific error message as this is in `/pkg` and
used by other projects.  Just set the default group for the current
user/group consuming the package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-04-27 09:26:21 -07:00
Brian Goff
acbfe6bc56 Use lazy unmount for local volume driver unmount
This fixes issues where the underlying filesystem may be disconnected and
attempting to unmount may cause a hang.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-04-27 08:43:43 -04:00
Vincent Demeester
c264aefdac Merge pull request #32768 from dnephin/try-enable-test-matches-on-windows
Enable TestMatches on windows
2017-04-23 15:54:45 +02:00
Daniel Nephin
9484c3bd81 Enable a unit test on windows.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-21 12:31:16 -04:00
Vincent Demeester
b0ba39d431
Use cli for trusted relate command
This also removed some skipped test (that are skipped for a long while).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-19 14:04:39 +02:00
Aaron Lehmann
6052f2b396 Remove pkg/testutil/assert in favor of testify
I noticed that we're using a homegrown package for assertions. The
functions are extremely similar to testify, but with enough slight
differences to be confusing (for example, Equal takes its arguments in a
different order). We already vendor testify, and it's used in a few
places by tests.

I also found some problems with pkg/testutil/assert. For example, the
NotNil function seems to be broken. It checks the argument against
"nil", which only works for an interface. If you pass in a nil map or
slice, the equality check will fail.

In the interest of avoiding NIH, I'm proposing replacing
pkg/testutil/assert with testify. The test code looks almost the same,
but we avoid the confusion of having two similar but slightly different
assertion packages, and having to maintain our own package instead of
using a commonly-used one.

In the process, I found a few places where the tests should halt if an
assertion fails, so I've made those cases (that I noticed) use "require"
instead of "assert", and I've vendored the "require" package from
testify alongside the already-present "assert" package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-14 12:03:21 -07:00
Daniel Nephin
e838679cd7 Add docs for reading Dockerfile from stdin.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-11 11:40:10 -04:00
Vincent Demeester
778e32a2fa Merge pull request #31236 from tonistiigi/docker-stdin
build: accept -f - to read Dockerfile from stdin
2017-04-10 20:14:54 +02:00
Brian Goff
8fabe07982 Merge pull request #32450 from miaoyq/fixed-a-bug-of-multireader
Reset the positions for all readers of multireader before reading the data
2017-04-10 11:39:47 -04:00
Yanqiang Miao
fd06bd6f96 Reset the position of all readers before reading the data
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-04-08 13:38:15 +08:00
Daniel Nephin
8cd6c30a48 Upadte archive.ReplaceFileTarWrapper() to not expect a sorted archive
Improve test coverage of ReplaceFileTarWrapper()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-06 13:36:34 -04:00
Brian Goff
fa3e2d5ab9 Merge pull request #32387 from Microsoft/jjh/tidystat
Tidy pkg\system *stat* functions
2017-04-06 08:40:27 -04:00
Brian Goff
9691170de9 Merge pull request #32383 from Microsoft/jjh/removeunused
Windows: Remove unused process_windows.go
2017-04-05 23:32:40 -04:00
Daniel Nephin
56bf6de9f7 Factor out adding dockerfile from stdin.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-05 19:42:31 -04:00
David Sheets
3f6dc81e10 build: accept -f - to read Dockerfile from stdin
Heavily based on implementation by David Sheets

Signed-off-by: David Sheets <sheets@alum.mit.edu>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-04-05 19:42:31 -04:00
John Howard
16c1ede79c Tidy pkg\system *stat* functions
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-04-05 16:01:53 -07:00
John Howard
329daee5ef Windows: Remove unused process_windows.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-04-05 11:04:34 -07:00
Aaron Lehmann
330a003533 Synchronous service create and service update
Change "service create" and "service update" to wait until the creation
or update finishes, when --detach=false is specified. Show progress bars
for the overall operation and for each individual task (when there are a
small enough number of tasks), unless "-q" / "--quiet" is specified.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-03 09:46:01 -07:00
Sebastiaan van Stijn
9c0473fa65 Merge pull request #32222 from unclejack/small_cleanup
Small cleanup
2017-03-30 21:09:39 +02:00
unclejack
a23c456e5a pkg/*: clean up a few issues
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-30 16:50:46 +03:00
unclejack
90a44b875c pkg/urlutil: don't compare to bool
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-30 16:38:01 +03:00
unclejack
20d6f5c2a9 pkg/file{utils,notify}: don't compare to bool
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-30 16:38:01 +03:00
unclejack
087f7307a6 pkg/{chroot,}archive: clean up a few small issues
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-30 16:37:54 +03:00
Aaron Lehmann
85357a1167 Make pkg/devicemapper and pkg/loopback depend on cgo in build tags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-29 17:55:42 -07:00
Aaron Lehmann
3da1192828 plugins: Rename plugins_linux.go to plugins_unix.go and use build tags
This allows pkg/authorization to build on OS X.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-29 14:06:59 -07:00
Vincent Demeester
95510551ce Merge pull request #32156 from cpuguy83/index_copy_new_slice
Don't pass reference to mutable slice
2017-03-28 10:23:08 +02:00
Brian Goff
d5b7839008 Don't pass reference to mutable slice
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-03-27 21:23:06 -04:00
Ivan Markin
925bc27b81 Fix building client on OpenBSD
Signed-off-by: Ivan Markin <twim@riseup.net>
2017-03-26 20:47:18 +00:00
Akihiro Suda
8008f65293 Merge pull request #31608 from vdemeester/integration-cli-package
[test-integration] Introduce a `cli` package for test-integration
2017-03-24 13:04:47 +09:00
Tõnis Tiigi
2fa8fe400d Merge pull request #31257 from tonistiigi/nested-build
build: add multi-stage build support
2017-03-23 19:14:13 -07:00
Tonis Tiigi
f95f58283b Add support for COPY from previous rootfs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-03-23 15:12:15 -07:00
Vincent Demeester
50c4475df6
Introduce a cli package for test-integration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-23 18:35:22 +01:00
Anusha Ragunathan
bbce24997c Merge pull request #31930 from anusha-ragunathan/authz-disable
When authz plugin is disabled, remove from authz middleware chain.
2017-03-22 14:17:38 -07:00
Anusha Ragunathan
38de272bd4 When authz plugin is disabled, remove from authz middleware chain.
When the daemon is configured to run with an authorization-plugin and if
the plugin is disabled, the daemon continues to send API requests to the
plugin and expect it to respond. But the plugin has been disabled. As a
result, all API requests are blocked. Fix this behavior by removing the
disabled plugin from the authz middleware chain.

Tested using riyaz/authz-no-volume-plugin and observed that after
disabling the plugin, API request/response is functional.

Fixes #31836

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-03-22 12:07:39 -07:00
Vincent Demeester
2422d5ad35 Merge pull request #31669 from tonistiigi/files-filter
Fix inefficient file paths filter
2017-03-20 17:43:47 +01:00
cooltoast
234b2203e5 Add Johannes Kepler and Mary Jackson to name generator
Signed-off-by: cooltoast <mpatel678@gmail.com>
2017-03-17 20:36:12 -07:00
unclejack
5957dc4899 pkg/archive/diff.go: avoid redundant options init
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-15 18:03:33 +02:00
Tonis Tiigi
c7c2cd4e8e Fix default socket group regression
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-03-14 16:09:08 -07:00
John Howard (VM)
f577131d3b Fix stringer in Result (pkg\testutil\cmd)
Signed-off-by: John Howard (VM) <jhoward@ntdev.microsoft.com>
2017-03-13 08:40:31 -07:00
James Nugent
4683f588ce pkg/system: Set appropriate CFLAGS on Solaris
The cgo in `meminfo_solaris.go` initializes variables in for loops, and
therefore requires a `-std=c99` `CFLAG` in order to compile (at least on
modern SmartOS).

Signed-off-by: James Nugent <james@jen20.com>
2017-03-09 13:40:05 -05:00
Tonis Tiigi
adeb3e3684 Fix inefficient file paths filter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-03-08 18:59:25 -08:00
Kenfe-Mickaël Laventure
9369acc776 Merge pull request #30733 from yongtang/02022017-formatter-header
Allow `--format` to use different delim in `table` format
2017-03-03 11:25:19 -08:00
Kenfe-Mickaël Laventure
d8b0d2b9e9 Merge pull request #30729 from dmcgowan/update-go-connections
Update go-connections package
2017-03-01 18:24:32 -08:00
Sebastiaan van Stijn
392ece2239
Improve coverage of pkg/ioutils/buffer
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-28 14:11:15 +01:00
phineas
da8cf590eb
Update copyright dates
Signed-off-by: phineas <phin@phineas.io>
2017-02-24 19:41:59 +00:00
Alexander Morozov
d52350d662 Merge pull request #30416 from stevenh/linux-mount-fixes
Fix linux mount calls not applying propagation type changes
2017-02-15 14:10:54 -08:00
Steven Hartland
b3b14b97b1 Fix linux mount calls not applying propagation type changes
Propagation type changes must be done as a separate call, in the
same way as read only bind mounts.

To fix this:
1. Ensure propagation type change flags aren't included in other calls.
2. Apply propagation type change in a separate call.

Also:
* Make it clear which parameters are ignored by passing them as empty.
* Add tests to ensure Mount options are applied correctly.

Fixes #30415

Signed-off-by: Steven Hartland <steven.hartland@multiplay.co.uk>
2017-02-15 14:15:09 +00:00
Drew Erny
f19b0d72d1 fix docker logs error handling
Previously, `docker logs` (and by extension, `docker service logs`) had
an error in the way they returned errors that occurred after a stream
had already been started. Specifically, the errors were added verbatim
to the HTTP response, which caused StdCopy to fail with an esoteric
error. This change updates StdCopy to accept errors from the source
stream and then return those errors when copying to the destination
stream.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-02-14 14:38:42 -08:00
Yong Tang
8b165cad1a Ignore some functions in the Go template when header is rendered
This fix ignore some functions in the Go template when header is
redendered, so that `--format "{{truncate .ID 1}}"` will still
be able to redener the header correctly.

Additional test cases have been added to the unit test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-10 19:34:50 -08:00
Brian Goff
bdf4cad1d1 Do group lookup in listeners package
This used to be handled by go-connections, but now it only takes a group
ID (int).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-09 16:38:52 -05:00
Derek McGowan
e5d77c64a2 Convert socket group to int
Sockets interface has been updated to take in a the group
id as an integer rather than a string.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-02-09 16:10:38 -05:00
Vincent Demeester
cb89d658dc
Bump go-units
To include  https://github.com/docker/go-units/pull/23
Fixes a unit test that fails because of it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-07 21:58:56 +01:00
Brian Goff
f907205f5d Merge pull request #30430 from Thynix/30374-remove-kickass
Replace "kickass" in name generator with "vigorous"
2017-02-01 10:33:07 -05:00
Steve Dougherty
2b30a79d9e
Replace "kickass" in name generator with "vigorous"
Having curse words in container names can get awkward.

Closes #30374.

Signed-off-by: Steve Dougherty <steve@asksteved.com>
2017-01-31 21:33:23 -05:00
Yong Tang
7fa8d5e064 Add truncate function for Go templates
This fix is part of the discussion in 28199 about using
`truncate` to replace `--no-trunc`.

As part of the fix, a new function `truncate` has been
added for Go templates so that it is possible to use
```
docker stack services --format "{{truncate .ID 5}}: {{.Mode}} {{.Replicas}}"
```
to show truncated ID.

A unit test has been added.

This fix is related to 28199.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-30 13:33:16 -08:00
Alexander Morozov
40c51569e2 Merge pull request #27713 from resouer/return-err
return when error happens on listener close
2017-01-27 12:29:08 -08:00