Commit graph

33098 commits

Author SHA1 Message Date
Brian Goff
4bf263c198 Fix plugin remove dir name after rename.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-07-04 07:37:26 -04:00
Sebastiaan van Stijn
c79c16910c
Add missing API documentatoin for DataPathAddr
COmmit 0307fe1a0b added
a new `DataPathAddr` property to the swarm/init and swarm/join
endpoints. This property was not yet added to the
documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-04 03:11:40 -07:00
Sebastiaan van Stijn
a9358df62c Merge pull request #33494 from cpuguy83/document_stream_format_in_client_lib
Add stream format details for attach/logs endpoint
2017-07-03 22:02:24 -07:00
Tibor Vass
48adb9d954 Merge pull request #33830 from cpuguy83/33799_fix_plugin_mounts_issue
Make plugin removes more resilient to failure
2017-07-03 18:37:31 -07:00
Sebastiaan van Stijn
b9f248d0ea Merge pull request #33884 from aaronlehmann/redact-secret-payload
middleware: Redact secret data on "secret create"
2017-07-03 14:18:32 -07:00
Brian Goff
c2ad549533 Merge pull request #33213 from gkze/master
GCP Logs: send log text as jsonPayload.message instead of jsonPayload.data
2017-07-03 16:18:18 -04:00
Josh Soref
39bcaee47b
Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-03 13:13:09 -07:00
Sebastiaan van Stijn
acd20d8a8e Merge pull request #33405 from jsoref/gofmt
gofmt: 5 files
2017-07-03 13:06:10 -07:00
Brian Goff
f8f1a3ade9 Merge pull request #33843 from moypray/exit
Set unpaused state when receiving 'stateExit' event
2017-07-03 16:02:18 -04:00
Michael Crosby
9d87e6e0fb Do not set -1 for swappiness
Do not set a default value for swappiness as the default value should be
`nil`

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-03 11:23:15 -07:00
Josh Soref
6284cf5e9a
gofmt: 5 files
gofmt from go1.8.3

hg locate '*.go' |xargs ~/go/bin/gofmt -s -w

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-03 10:32:47 -07:00
Aleksa Sarai
198f83bba1
devicemapper: add --storage-opt dm.libdm_log_level=X option
Because we use our own logging callbacks in order to use libdm
effectively, it is quite difficult to debug complicated devicemapper
issues (because any warnings or notices from libdm are muted by our own
callback function). e07d3cd9a ("devmapper: Fix libdm logging") further
reduced the ability of this debugging by only allowing _LOG_FATAL errors
to be passed to the output.

Unfortunately libdm is very chatty, so in order to avoid making the logs
even more crowded, add a dm.libdm_log_level storage option that allows
people who are debugging the lovely world of libdm to be able to dive in
without recompiling binaries.

The valid values of dm.libdm_log_level map directly to the libdm logging
levels, and are in the range [2,7] as of the time of writing with 7
being _LOG_DEBUG and 2 being _LOG_FATAL. The default is _LOG_FATAL.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-04 02:04:26 +10:00
Aleksa Sarai
cfd39e8d6d
devicemapper: change LogInit and move all callbacks to pkg
LogInit used to act as a manual way of registering the *necessary*
pkg/devicemapper logging callbacks. In addition, it was used to split up
the logic of pkg/devicemapper into daemon/graphdriver/devmapper (such
that some things were logged from libdm).

The manual aspect of this API was completely non-sensical and was just
begging for incorrect usage of pkg/devicemapper, so remove that semantic
and always register our own libdm callbacks.

In addition, recombine the split out logging callbacks into
pkg/devicemapper so that the default logger is local to the library and
also shown to be the recommended logger. This makes the code
substantially easier to read. Also the new DefaultLogger now has
configurable upper-bound for the log level, which allows for dynamically
changing the logging level.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-04 02:04:26 +10:00
Aleksa Sarai
c654147f06
devicemapper: actually remove DmLogInitVerbose
e07d3cd9a ("devmapper: Fix libdm logging") removed all of the callers of
DmLogInitVerbose, but we still kept around the wrapper. However, the
libdm dm_log_init_verbose API changes the verbosity of the *default*
libdm logger. Because pkg/devicemapper internally *relies* on using
logging callbacks to understand what errors were encountered by libdm,
this wrapper is useless (it only makes sense for the default logger
which we do not user).

Any user not inside Docker of this function almost certainly was not
using this API correctly, because pkg/devicemapper will misbehave if our
logging callbacks were not registered.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-04 02:04:26 +10:00
Aleksa Sarai
63328c6882
devicemapper: remove 256 character limit of libdm logs
This limit is unecessary and can lead to the truncation of long libdm
logs (which is quite annoying).

Fixes: b440ec013 ("device-mapper: Move all devicemapper spew to log through utils.Debugf().")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-04 02:04:26 +10:00
Victor Vieux
8bc681262f Merge pull request #33899 from cyphar/make-dynbinary
make: add dynbinary target
2017-07-03 17:50:20 +02:00
Victor Vieux
75a034621d Merge pull request #33888 from thaJeztah/enable-version-negotiation
Always perform version-negotiation
2017-07-03 17:46:35 +02:00
Victor Vieux
d061ad4a1b Merge pull request #33926 from coolljt0725/fix_wrong_file_mode
Fix wrong filemode for rotate log files
2017-07-03 17:45:14 +02:00
Vincent Demeester
cab50de4d6 Merge pull request #33908 from thaJeztah/carry-33883-ignore-nonexistent-containers
[carry 33883] daemon: Ignore nonexistent containers when listing containers
2017-07-03 17:06:54 +02:00
Wentao Zhang
fe1b4cfba6 Set unpasued state when receiving 'stateExit' event
Description:
 1. start a container with restart=always.
    `docker run -d --restart=always ubuntu sleep 3`
 2. container init process exits.
 3. use `docker pause <id>` to pause this container.

if the pause action is before cgroup data is removed and after the init process died.
`Pause` operation will success to write cgroup data, but actually do not freeze any process.

And then docker received pause event and stateExit event from
containerd, the docker state will be Running(paused), but the container
is free running.

Then we can not remove it, stop it , pause it  and unpause it.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
2017-07-03 17:26:13 +08:00
Victor Vieux
714c226b43 Merge pull request #33853 from vieux/report-2017-06-26
Moby Dev Report 2017 06 26
2017-07-03 11:18:11 +02:00
Lei Jitang
96ea8eaa15 Fix wrong filemode for rotate log files
the filemode should be 0640 but not 06400

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-07-03 03:49:22 -04:00
Sebastiaan van Stijn
7117d5ef25 Merge pull request #33920 from thaJeztah/remove-fork-message
Remove comment about forked golang.org/x/net
2017-07-02 00:29:30 -07:00
Sebastiaan van Stijn
fe877c2b95
Remove comment about forked golang.org/x/net
This dependency was temporarily forked, but
the fork was removed in db37a86d37.

This patch removes the comment

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-02 00:19:15 -07:00
Aaron Lehmann
d257a63fb6
daemon: Ignore nonexistent containers when listing containers
The name/ID relationships are maintained separately from the memdb and
can be out of sync from any particular memdb snapshot. If a container
does not exist in the memdb, we must accept this as normal and not fail
the listing. This is consistent with what the code used to do before
memdb was introduced.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-30 15:19:47 -07:00
Aleksa Sarai
c81255c9c0
make: add dynbinary target
Recently, it's become necessary to build dynbinaries on certain
distributions, so make it easier for users to build dynbinaries. It
looks like this was just an oversight when we added dynbinary builds.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-01 04:54:57 +10:00
Brian Goff
87df0e533b Merge pull request #33875 from tmp6154/master
Change order of arguments in assertion to be more logical
2017-06-30 14:46:11 -04:00
Brian Goff
2b20737778 Merge pull request #33890 from ripcurld0/nesting_fix
Refactor MountPoint Setup function in volume.go
2017-06-30 14:40:50 -04:00
Brian Goff
18d874a20f Merge pull request #33882 from aaronlehmann/memdb-no-container
container: Handle failed memdb lookups
2017-06-30 14:31:10 -04:00
Vivek Goyal
36cb6efebc Wait for device removal if deferredRemoval=true and deferredDeletion=false
There have been some cases where umount, a device can be busy for a very
short duration. Maybe its udev rules, or maybe it is runc related races
or probably it is something else. We don't know yet.

If deferred removal is enabled but deferred deletion is not, then for the
case of "docker run -ti --rm fedora bash", a container will exit, device
will be deferred removed and then immediately a call will come to delete
the device. It is possible that deletion will fail if device was busy
at that time.

A device can't be deleted if it can't be removed/deactivated first. There
is only one exception and that is when deferred deletion is on. In that
case graph driver will keep track of deleted device and try to delete it
later and return success to caller.

Always make sure that device deactivation is synchronous when device is
being deleted (except the case when deferred deletion is enabled).

This should also take care of small races when device is busy for a short
duration and it is being deleted.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2017-06-30 14:27:26 -04:00
Victor Vieux
8b0384fd89 add dev report 2017-06-26
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-06-30 17:19:40 +02:00
Vincent Demeester
b8766fe793 Merge pull request #33824 from ijc/build-iidfile-with-squash
builder: Emit a BuildResult after squashing.
2017-06-30 16:42:23 +02:00
Brian Goff
11cf394e5e Make plugin removes more resilient to failure
Before this patch, if the plugin's `config.json` is successfully removed
but the main plugin state dir could not be removed for some reason (e.g.
leaked mount), it will prevent the daemon from being able to be
restarted.

This patches changes this to atomically remove the plugin such that on
daemon restart we can detect that there was an error and re-try. It also
changes the logic so that it only logs errors on restore rather than
erroring out the daemon.

This also removes some code which is now duplicated elsewhere.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-06-30 09:58:19 -04:00
Boaz Shuster
fb8b27cd41 Refactor MountPoint Setup function in volume.go
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-06-30 11:09:49 +03:00
Sebastiaan van Stijn
5975dc4b4b
Always perform version-negotiation
If a client is initialized without a specific
version set, version negotiation would not be
functional.

This patch changes the behavior to always
perform version negotation (if called), in
which case the "current" (maximum supported
API version) is used as a default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-29 22:24:49 -07:00
Sebastiaan van Stijn
ff2ed18530
Fix NewVersionError() for clients using default version
The NewVersionError checks if the client is using the API version
required for using a specific feature.

If the client is initialized without setting a specific version, an
error would be generated because it was not possible to compare
versions. However, a client without explicit version set is running
the latest supported version.

This patch changes the behavior to only generate an error if a version
was set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-29 22:22:32 -07:00
Aaron Lehmann
c26b0cdfd1 container: Handle failed memdb lookups
If a container doesn't exist in the memdb, First will return nil, not an
error. This should be checked for before using the result.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-29 16:33:30 -07:00
Aaron Lehmann
3fbc352cbb middleware: Redact secret data on "secret create"
With debug logging turned on, we currently log the base64-encoded secret
payload.

Change the middleware code to redact this. Since the field is called
"Data", it requires some context-sensitivity. The URI path is examined
to see which route is being invoked.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-29 16:04:47 -07:00
Sebastiaan van Stijn
82390ebf32 Merge pull request #33873 from lixiaobing1/masterissue
update url for issue
2017-06-29 13:48:19 -07:00
Sebastiaan van Stijn
654bb6368b Merge pull request #33827 from cpuguy83/return_ping_data_if_available
Set ping version even on error
2017-06-29 12:27:23 -07:00
Brian Goff
27ef09a46f Set ping version even on error
In some cases a server may return an error on the ping response but
still provide version details. The client should use these values when
available.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-06-29 12:42:14 -04:00
Brian Goff
e066edcfcf Merge pull request #33860 from lixiaobing1/masterFclose
add f.Close()  after dockerignore.ReadAll(f) before return err
2017-06-29 10:19:45 -04:00
Vincent Demeester
5fbc82128b Merge pull request #33647 from johnstep/improve-load-error
Stop trying to load images on an incompatible OS
2017-06-29 16:12:32 +02:00
Brian Goff
1ca83a6595 Merge pull request #33831 from cpuguy83/ignore_enotsup_on_relabel
Do not error on relabel when relabel not supported
2017-06-29 10:08:47 -04:00
Brian Goff
fcaa79b842 Merge pull request #33867 from nishanttotla/fix-duplicate-platform-info
Do not add duplicate platform information to service spec
2017-06-29 09:36:01 -04:00
Vitaly Ostrosablin
07cc701947 Change order of arguments in assertion to be more logical
Because of argument order to assert, in case of fail, we'll get message
like:

... obtained string = "uid=100(test) gid=101(test)\n"
... expected string = "uid=100(test) gid=101(test) groups=101(test)\n"

But obtained string should be second one, not the first one. And
expected string should be first. Here's sample output from test above:

... Output: before restart 'uid=100(test) gid=101(test)
', after restart 'uid=100(test) gid=101(test) groups=101(test)

It's confusing, because expected order of strings in assertion is
reversed. What goes before restart - should be "expected string" and
what goes after - should be "obtained string".

Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
2017-06-29 12:38:13 +03:00
lixiaobing10051267
6fcae83036 update url for issue
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-06-29 17:10:02 +08:00
lixiaobing10051267
3072fce067
add f.Close() after dockerignore.ReadAll(f) before return err
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-29 00:51:31 -07:00
Sebastiaan van Stijn
b7ac1571a3 Merge pull request #33851 from tonistiigi/fix-add-remote
build: fix add from remote url
2017-06-28 23:53:21 -07:00
Nishant Totla
da85b62001
Do not add duplicate platform information to service spec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-06-28 16:01:05 -07:00