Commit graph

4971 commits

Author SHA1 Message Date
Vincent Demeester
e1101b1295 Merge pull request #32470 from runcom/remove-init-client
remove --init-path from client
2017-04-25 10:25:58 +02:00
Vincent Demeester
a3a109d956 Merge pull request #32341 from ripcurld0/tt_rm_ut
Use a test table in the daemon delete unit tests
2017-04-25 10:25:05 +02:00
John Howard
d0ce488d9d Merge pull request #32608 from darrenstahlmsft/WindowsNanoCPUs
Windows: Fix scaling of NanoCPUs (--cpus) on Hyper-V containers
2017-04-24 10:54:14 -05:00
Vincent Demeester
f9311c52ce Merge pull request #31912 from AkihiroSuda/ovl-on-non-swarm
improve error of `docker network create -d overlay` on non-Swarm node
2017-04-24 17:20:48 +02:00
Brian Goff
a709f79c1a Merge pull request #32654 from allencloud/use-make-slice-to-store-swarmkit-objects
use make slice to store cluster objects to improve efficiency
2017-04-22 12:02:34 -04:00
Vincent Demeester
b8e9250b59 Merge pull request #32668 from darrenstahlmsft/CleanupEmpty
Windows: Do not clean empty windowsfilter folder
2017-04-20 14:55:45 +02:00
Boaz Shuster
8f51746997 Use a test table in the daemon delete unit tests
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-04-18 10:30:40 +03:00
Darren Stahl
5e4e357f6e Windows: Do not attempt to clean empty windowsfilter folder
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-04-17 13:10:15 -07:00
Darren Stahl
5cea9a0aa5 Fix tmp folder deletion
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-04-17 13:09:40 -07:00
Daniel Nephin
1eec7b5583 Merge pull request #32614 from aaronlehmann/testify
Remove pkg/testutil/assert in favor of testify
2017-04-17 11:07:08 -04: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
Aaron Lehmann
8a27758364 Hide zero-valued timestamps from service JSON
It was possible to see output like this:

        "UpdateStatus": {
            "State": "updating",
            "StartedAt": "2017-04-14T17:10:03.226607162Z",
            "CompletedAt": "1970-01-01T00:00:00Z",
            "Message": "update in progress"
        }

The timestamp fields were already changed to pointers, and left nil if
the timestamp value was zero. However the zero-value of a timestamp from
gRPC is different from the value Go considers to be zero. gRPC uses the
Unix epoch instead of Go's epoch. Therefore, check that the timestamp
does not match the Unix epoch.

Also, add " ago" to the timestamps as shown in "docker service inspect
--pretty", as they are shown as relative times.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-14 10:44:24 -07:00
allencloud
ac245e2845 use make slice to store objects to improve efficiency
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-04-14 11:02:28 +08:00
Tõnis Tiigi
01c80435c6 Merge pull request #32449 from aaronlehmann/cluster-locking
cluster: Allow reentrant calls to methods during shutdown
2017-04-12 18:58:12 -07:00
Darren Stahl
3b5af0a289 Fix scaling of NanoCPUs on Hyper-V containers
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-04-12 16:54:27 -07:00
Anusha Ragunathan
d40a17ffc2 Merge pull request #28923 from erikh/fix-copy
Fix copy API (`docker cp`, etc) uid/gid handling
2017-04-12 08:21:17 -07:00
Evan Hazlett
2aec48f448 Merge pull request #32529 from runcom/relabel-secrets
daemon: relabel secrets path
2017-04-12 08:30:30 -04:00
Erik Hollensbe
8a7ff5ff74 daemon/archive.go: Fix copy routines to preserve UID.
This changes the long-standing bug of copy operations not preserving the
UID/GID information after the files arrive to the container.

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2017-04-12 10:33:19 +00:00
Akihiro Suda
9c77a4c297 improve error of docker network create -d overlay on non-Swarm node
before: Error response from daemon: datastore for scope "global" is not initialized
after: Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-04-12 05:31:00 +00:00
Evan Hazlett
dc762610ab add service convert tests
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:02 -04:00
Evan Hazlett
3a9be92927 return exec.Controller instead of nil
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:02 -04:00
Evan Hazlett
8c2c69d31e updates for review comments
- runtimeUrl -> type_url
- runtimes -> runtime

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:01 -04:00
Evan Hazlett
f71bdc67a2 filter services by runtime; default to container
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:01 -04:00
Evan Hazlett
e06e2ef107 add support for swarmkit generic runtime
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:01 -04:00
Antonio Murdaca
b11af7b2f6
daemon: relabel secrets path
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-04-11 17:43:23 +02:00
Brian Goff
b93db34363 Merge pull request #32503 from dongluochen/fix_startperiod
fix gRPC serialization for healthcheck start-period
2017-04-11 10:19:16 -04:00
Sebastiaan van Stijn
a258ef58d8 Merge pull request #32284 from aaronlehmann/fix-service-defaults
Improve default handling for "service create"
2017-04-11 13:06:53 +02:00
Victor Vieux
a6746e6ca5 Merge pull request #31954 from darrenstahlmsft/GraphdriverReference
Windows: Fix reference counting in graphdriver
2017-04-10 20:23:15 -07:00
Victor Vieux
74093fe4ca Merge pull request #32092 from alfred-landrum/gdcaps
Let graphdrivers declare diff stream fidelity
2017-04-10 18:20:32 -07:00
Darren Stahl
7fab9b8a60 Windows: Fix reference counting in graphdriver
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-04-10 17:13:17 -07:00
Dong Chen
caab178509 fix gRPC serialization for healthcheck start-period
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2017-04-10 17:02:58 -07:00
Aaron Lehmann
1d274e9acf Change "service inspect" to show defaults in place of empty fields
This adds a new parameter insertDefaults to /services/{id}. When this is
set, an empty field (such as UpdateConfig) will be populated with
default values in the API response. Make "service inspect" use this, so
that empty fields do not result in missing information when inspecting a
service.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-10 13:41:16 -07:00
Sebastiaan van Stijn
129d1f7051 Merge pull request #32479 from aboch/vnd
Do not error out on serv bind deactivation if no sbox is found
2017-04-10 22:16:04 +02:00
Sebastiaan van Stijn
28334c1d82 Merge pull request #28403 from cpuguy83/logging_plugins
Implement plugins for logging drivers
2017-04-10 21:57:56 +02:00
Sebastiaan van Stijn
5b1cae2271 Merge pull request #31148 from yongtang/31032-NanoCPU-update
Add `--cpus` support for `docker update`
2017-04-10 20:02:15 +02:00
Vincent Demeester
4460312ce1 Merge pull request #30740 from yongtang/29999-prune-filter-label
Add `label` filter for `docker system prune`
2017-04-10 19:38:01 +02:00
Brian Goff
27bd6842f8 Implement plugins for logging drivers
Logging plugins use the same HTTP interface as other plugins for basic
command operations meanwhile actual logging operations are handled (on
Unix) via a fifo.

The plugin interface looks like so:

```go
type loggingPlugin interface {
  StartLogging(fifoPath string, loggingContext Context) error
  StopLogging(fifoPath)
```

This means a plugin must implement `LoggingDriver.StartLogging` and
`LoggingDriver.StopLogging` endpoints and be able to consume the passed
in fifo.

Logs are sent via stream encoder to the fifo encoded with protobuf.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-04-10 13:17:20 -04:00
Alessandro Boch
2418f25767 Do not error out on serv bind deactivation if no sbox is found
- If the nw sbox is not there, then there is nothing to deactivate.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-04-10 09:13:41 -07:00
Antonio Murdaca
a18d103b5e
remove --init-path from client
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-04-10 16:49:43 +02:00
Sunny Gogoi
17b1288760 Fix missing Init Binary in docker info output
- Moved DefaultInitBinary from daemon/daemon.go to
daemon/config/config.go since it's a daemon config and is referred in
config package files.
- Added condition in GetInitPath to check for any explicitly configured
DefaultInitBinary. If not, the default value of DefaultInitBinary is
returned.
- Changed all references of DefaultInitBinary to refer to the variable
from new location.
- Added TestCommonUnixGetInitPath to test for the various values of
GetInitPath.

Fixes #32314

Signed-off-by: Sunny Gogoi <indiasuny000@gmail.com>
2017-04-10 16:54:07 +05:30
Sebastiaan van Stijn
51aa2a226e Merge pull request #32436 from thaJeztah/refactor-tiny-version-parsing
Refactor tiny version parsing
2017-04-08 17:36:40 +02:00
Sebastiaan van Stijn
72eddf4258
Refactor "init" version parsing, and add unit-test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-04-08 11:28:37 +02:00
Aaron Lehmann
44ce809c95 cluster: Allow reentrant calls to methods during shutdown
The agent sometimes calls into libnetwork code that in turn calls
(*Cluster).IsAgent and (*Cluster).IsManager. These can cause the
node shutdown process to time out, since they wait for a lock that is
held by Cleanup.

It turns out c.mu doesn't need to be held while calling Stop. Holding
controlMutex is sufficient. Also, (*nodeRunner).Stop must release
nodeRunner's mu during the node shutdown process, otherwise the same
call into Cluster would be blocked on this lock instead.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-07 19:21:10 -07:00
Sebastiaan van Stijn
091b5e68ea Merge pull request #32339 from aluzzardi/selinux
services: Add support for Credential Spec and SELinux
2017-04-08 01:37:17 +02:00
Brian Goff
4a1a64c677 Merge pull request #32154 from dperny/refactor-logs
Refactor logs and support service logs with TTY
2017-04-07 18:06:50 -04:00
Andrea Luzzardi
89a995a9d7 services: Add support for Credential Spec and SELinux
- Defined "normalized" type for Credential Spec and SELinux
- Added --credential-spec to docker service create & update
- SELinux is API only at the time

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2017-04-07 11:30:54 -07:00
Vincent Demeester
87562af45b Merge pull request #32283 from aboch/clearingress
Daemon to take care of ingress cleanup on cluster leave and graceful shutdown
2017-04-07 20:09:27 +02:00
Sebastiaan van Stijn
984d99e19c Fix tini version parsing
Invalid version strings for the init (tini)
binary were still accepted, which lead to (e.g.)

"hello world"

Being used as "vhello world"

This makes the version parsing slightly stricter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-04-07 17:12:07 +02:00
Brian Goff
3de58eb2bc Merge pull request #30261 from aaronlehmann/rollout-mode
swarm: Add update/rollback order
2017-04-06 22:41:11 -04:00
Brian Goff
7d8bf5d177 Merge pull request #30669 from catinthesky/issue30580
Fixing issue of docker top command failure when dealing with -m option
2017-04-06 21:14:26 -04:00