Commit graph

4842 commits

Author SHA1 Message Date
Victor Vieux
08bbd434f5 Merge pull request #31586 from aaronlehmann/digest-pin-context
cluster: Renew the context after communicating with the registry
2017-03-14 09:46:15 -07:00
Vincent Demeester
1d4608032d Merge pull request #31500 from dperny/fix-service-logs-cli
Add tail and since to service logs
2017-03-14 14:19:29 +01:00
Tõnis Tiigi
764e80e84c Merge pull request #31713 from nishanttotla/better-warnings
Improve warnings when image digest pinning fails
2017-03-13 17:57:06 -07:00
Nishant Totla
44855dff42
Improve warnings when image digest pinning fails
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-03-13 15:16:35 -07:00
Aaron Lehmann
47615d9871 Merge pull request #31674 from dperny/service-logs-err-on-tty
Error on attempting services logs on TTY container
2017-03-13 10:17:33 -07:00
Justin Cormack
2c6a1e1878 Merge pull request #31579 from ijc25/cpuacct
Correct CPU usage calculation in presence of offline CPUs and newer Linux
2017-03-13 16:32:18 +00:00
Aleksa Sarai
790a81ea9a
daemon: also ensureDefaultApparmorProfile in exec path
When 567ef8e785 ("daemon: switch to 'ensure' workflow for AppArmor
profiles") was merged, it didn't correctly handle the exec path if
AppArmor profiles were deleted. Fix this by duplicating the
ensureDefaultApparmorProfile code in the exec code.

Fixes: 567ef8e785 ("daemon: switch to 'ensure' workflow for AppArmor profiles")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-03-13 15:20:05 +11:00
Drew Erny
8dc437bd9b Add tail and since to service logs
This change adds the ability to do --tail and --since on docker service
logs. It wires up the API endpoints to each other and fixes some older
bugs. It adds integration tests for these new features.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-03-10 14:59:00 -08:00
Drew Erny
37ae1ef0ff Error on attempting service logs on TTY container
Right now getting logs from a service with an attached TTY does not
work. The behavior was undefined and caused the command to hang and
strange messages to occur in the daemon logs.

This returns errors, both deep in the swarmkit adapter (to guard against
undefined behavior, which is Bad) and in the daemon (to tell users that
the thing they're asking for is not possible).

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-03-10 14:48:56 -08:00
Brian Goff
2c2983cd8e Merge pull request #31665 from mlaventure/aufs-lsof-oob
Remove aufs debugEBusy()
2017-03-10 11:51:14 -05:00
Ian Campbell
115f91d757 Correct CPU usage calculation in presence of offline CPUs and newer Linux
In https://github.com/torvalds/linux/commit/5ca3726 (released in v4.7-rc1) the
content of the `cpuacct.usage_percpu` file in sysfs was changed to include both
online and offline cpus. This broke the arithmetic in the stats helpers used by
`docker stats`, since it was using the length of the PerCPUUsage array as a
proxy for the number of online CPUs.

Add current number of online CPUs to types.StatsJSON and use it in the
calculation.

Keep a fallback to `len(v.CPUStats.CPUUsage.PercpuUsage)` so this code
continues to work when talking to an older daemon. An old client talking to a
new daemon will ignore the new field and behave as before.

Fixes #28941.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-03-10 10:24:33 +00:00
Sebastiaan van Stijn
6c31abde20 Merge pull request #30870 from ripcurld0/fix_msg_rm
Fix the rm error message when a container is restarting/paused
2017-03-10 10:04:49 +01:00
Aaron Lehmann
9d127f8de3 cluster: Fix shadowed resp variable
The response would never reach the client because it was being
redeclared in the current scope.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-09 17:58:12 -08:00
Boaz Shuster
0ec8f56a3d Fix the rm error message when a container is restarting/paused
Running the rm command on a paused/restarting container
will give an error message saying the container is running
which is incorrect.

To fix that, the error message will have the correct
container state and a procedure to remove it accordingly.

Notice: docker-py was bumped to:
        4a08d04aef0595322e1b5ac7c52f28a931da85a5

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-03-10 00:39:16 +02:00
Kenfe-Mickael Laventure
eac66b67be Remove aufs debugEBusy()
Since it was introduced no reports were made and lsof seems to cause
issues on some systems.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-03-09 14:35:13 -08:00
Vincent Demeester
d4a8c3b438 Merge pull request #30856 from allencloud/make-secret-update-support-name-and-id-prefix
make secret update support name and id prefix
2017-03-08 12:31:44 +01:00
Aaron Lehmann
497c4f05b9 Fix dropped field in task translation from GRPC to REST
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-07 14:55:15 -08:00
Brian Goff
fd5f9d7941 Merge pull request #31265 from cyli/remove_swarm_subdirs
Rather than remove the swarm directory and re-create, remove the subdirs
2017-03-07 14:30:34 -05:00
allencloud
9d30525a04 make secret update support name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-03-07 16:01:21 +08:00
Aaron Lehmann
f8273a216e cluster: Renew the context after communicating with the registry
When pinning by digest, the registry might be slow or unresponsive. This
could cause the context to already be expired by the time UpdateService
or CreateService is called. We want digest pinning to be a best-effort
operation, so it's problematic if a slow or misbehaving registry
prevents the service operation from completing. Replace the context
after communicating with the registry, so we have a fresh timeout for
the gRPC call.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-06 16:05:56 -08:00
Vincent Demeester
95cb74818a Merge pull request #31450 from thaJeztah/fix-volume-force-remove
do not ignore "volume in use" errors when force-delete
2017-03-06 14:35:46 +01:00
Aaron Lehmann
f9bd8ec8b2 Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Aaron Lehmann
3a88a24d23 Add support for rollback flags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Aaron Lehmann
cc9d04647a Add support for the "rollback" failure action
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Sebastiaan van Stijn
57fd478169 Merge pull request #31083 from xulike666/fight-for-readability
fix some typos from module contrib to man
2017-03-03 15:13:01 +01:00
Sebastiaan van Stijn
3a5a1c3f3d Merge pull request #30725 from aaronlehmann/topology
Topology-aware scheduling
2017-03-03 15:01:12 +01:00
Sebastiaan van Stijn
e1da516598 Merge pull request #30265 from allencloud/add-CheckDuplicate-details-and-logic
add CheckDuplicate docs and logics in network
2017-03-03 14:18:52 +01:00
Vincent Demeester
dc1b0e1b2c Merge pull request #28279 from chchliang/updown
--max-concurrent-downloads,--max-concurrent-uploads must great than or equal to 0
2017-03-03 10:06:59 +01:00
Vincent Demeester
f4e82d71a8 Merge pull request #31491 from rawkode/feature/healthchecks-missing-environment
Healthchecks should inherit environment
2017-03-03 08:36:37 +01:00
Brian Goff
55b955d9ff Merge pull request #31409 from yuexiao-wang/fix-version
'docker daemon' deprecation message doesn't use the new version
2017-03-02 22:02:09 -05:00
yuexiao-wang
5a9cee7bb5 'docker daemon' deprecation message doesn't use the new versioning scheme
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2017-03-03 17:26:49 +08:00
David McKay
647dce9dea
Healthchecks should inherit environment
Signed-off-by: David McKay <david@rawkode.com>
2017-03-02 16:23:56 +00:00
Vincent Demeester
3e561e4a84 Merge pull request #31356 from coolljt0725/fix_suspend
devicemapper: Fix suspend a removed device
2017-03-02 10:11:48 +01:00
chchliang
e59af2abe6 --max-concurrent-downloads,--max-concurrent-uploads must great than or equal to 0
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
2017-03-02 09:23:01 +08:00
Alexander Morozov
9358189fa3 Merge pull request #30657 from madhanrm/ns1
Support --net=container:<NameOrID> for windows (Shared Pod Network)
2017-03-01 13:59:52 -08:00
Ying Li
68506bd239 Rather than remove the swarm directory and re-create, remove the swarm subdirs
Signed-off-by: Ying Li <ying.li@docker.com>
2017-03-01 11:56:39 -08:00
Sebastiaan van Stijn
bb9f19503c Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
2017-03-01 18:10:57 +01:00
Sebastiaan van Stijn
9d521a4d2f
do not ignore "volume in use" errors when force-delete
When using `docker volume rm -f`, all errors were ignored,
and volumes where Purged, even if they were still in
use by a container.

As a result, repeated calls to `docker volume rm -f`
actually removed the volume.

The `-f` option was implemented to ignore errors
in case a volume was already removed out-of-band
by a volume driver plugin.

This patch changes the remove function to not
ignore "volume in use" errors if `-f` is used.
Other errors are still ignored as before.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-03-01 16:36:43 +01:00
Lei Jitang
6e25bb2ed6 devicemapper: fix suspend removed device
when doing devices.cancelDeferredRemoval, the device could have been removed
and return ErrEnxio, but it continue to check if it is need to do suspend.
doSuspend := devinfo != nil && devinfo.Exists != 0 uses a devinfo which is
get before devices.cancelDeferredRemoval(baseInfo), it is outdate, the device
has been removed and there is no need to do suspend. If do suspend it will return
devicemapper: Error running deviceSuspend dm_task_run failed.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-03-01 21:58:14 +08:00
Madhan Raj Mookkandy
040afcce8f (*) Support --net:container:<containername/id> for windows
(*) (vdemeester) Removed duplicate code across Windows and Unix wrt Net:Containers
(*) Return unsupported error for network sharing for hyperv isolation containers

Signed-off-by: Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com>
2017-02-28 20:03:43 -08:00
Vincent Demeester
40f390e67e Merge pull request #31384 from allencloud/validate-extrahosts-in-deamon-side
validate extraHosts in daemon side
2017-02-28 18:28:10 +01:00
Vincent Demeester
250e05e427
Add a lockedManagerAction method to Cluster…
… in order to remove duplication.
Each time we update a cluster object, we do some common
operations (lock, verify it's on a manager, get the request context,
and the update). This introduce a method and refactor few
update/remove method that allows to duplicate less code.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 11:12:11 +01:00
Vincent Demeester
f7819fcb25
Refactor cpu-realtime file creation to remove duplication
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 11:12:06 +01:00
Vincent Demeester
2028d8698d
Reduce duplication in graphdriver
Removes some duplication in counter.go and proxy.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 11:12:02 +01:00
Vincent Demeester
cb6832c6d3
Extract common code from disconnectFromNetwork and releaseNetwork
Both method are trying to detach the container from a cluster
network. The code is exactly the same, this removes the duplication.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 11:11:59 +01:00
Vincent Demeester
af0d9bdfe4
Refactor publish/expose filter to remove duplication
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 11:11:55 +01:00
Vincent Demeester
12485d62ee
Introduce a CheckContainer to remove duplication
Some methods need to get a container *and* validate some conditon on
these (is the container running, …). The CheckContainer allows
to do that and helps remove some duplication.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 11:11:48 +01:00
Vincent Demeester
a620c0172c
Refactor endpoint*FromGRPC to limit duplication
endpointSpecFromGRPC and endpointFromGRPC do the exact same thing for
endpoint{,Spec}.Ports, let's extract that to a method.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 10:51:55 +01:00
Vincent Demeester
3c5932086a
Remove daemon.VXSubnets duplicate code
Refactor daemon.V4Subnets and daemon.V6Subnets to limit duplication

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-28 10:51:40 +01:00
allencloud
d524dd95cc validate extraHosts in daemon side
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-28 10:37:59 +08:00