Commit Graph

4836 Commits

Author SHA1 Message Date
1b786f2dda Merge pull request #31674 from dperny/service-logs-err-on-tty
Error on attempting services logs on TTY container
Upstream-commit: 47615d9871510cdad0f894f8bc9e82c1a9873fa5
Component: engine
2017-03-13 10:17:33 -07:00
067b63e8af Merge pull request #31579 from ijc25/cpuacct
Correct CPU usage calculation in presence of offline CPUs and newer Linux
Upstream-commit: 2c6a1e1878975550cd2e7a98494773903e39eaf7
Component: engine
2017-03-13 16:32:18 +00:00
c2b7c22146 daemon: also ensureDefaultApparmorProfile in exec path
When 567ef8e7858c ("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: 567ef8e7858c ("daemon: switch to 'ensure' workflow for AppArmor profiles")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 790a81ea9acce318d0e037771c253951b874140b
Component: engine
2017-03-13 15:20:05 +11:00
218618324e 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>
Upstream-commit: 37ae1ef0ffcf8605daeaf41440da774370377a6d
Component: engine
2017-03-10 14:48:56 -08:00
da62433767 Merge pull request #31665 from mlaventure/aufs-lsof-oob
Remove aufs debugEBusy()
Upstream-commit: 2c2983cd8e58630889712c40a614714ce0c68efc
Component: engine
2017-03-10 11:51:14 -05:00
6f5f3ec34f 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>
Upstream-commit: 115f91d7575d6de6c7781a96a082f144fd17e400
Component: engine
2017-03-10 10:24:33 +00:00
9365b0d405 Merge pull request #30870 from ripcurld0/fix_msg_rm
Fix the rm error message when a container is restarting/paused
Upstream-commit: 6c31abde2057854bc83c03de971c38ca18264ab4
Component: engine
2017-03-10 10:04:49 +01:00
e92d0c63e0 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>
Upstream-commit: 9d127f8de3fa489b2c0d896dd9612f43e45f7cdd
Component: engine
2017-03-09 17:58:12 -08:00
9298102f46 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>
Upstream-commit: 0ec8f56a3d7f1413cdb3ae7711d518e99f9282e9
Component: engine
2017-03-10 00:39:16 +02:00
188830de7a 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>
Upstream-commit: eac66b67be0710322d0e21a67a55f5731be48f68
Component: engine
2017-03-09 14:35:13 -08:00
8c76bad868 Merge pull request #30856 from allencloud/make-secret-update-support-name-and-id-prefix
make secret update support name and id prefix
Upstream-commit: d4a8c3b438cb8ae95916fee3e7fac93639b720f6
Component: engine
2017-03-08 12:31:44 +01:00
f7cd555009 Fix dropped field in task translation from GRPC to REST
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 497c4f05b931a7f64785543922b19e94362607e6
Component: engine
2017-03-07 14:55:15 -08:00
569aaf9edd Merge pull request #31265 from cyli/remove_swarm_subdirs
Rather than remove the swarm directory and re-create, remove the subdirs
Upstream-commit: fd5f9d7941287cbbaeecfd16e0159508b3f6af63
Component: engine
2017-03-07 14:30:34 -05:00
4340eba05a make secret update support name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9d30525a04e2d4efe51ac9e6c114ce36276aafa8
Component: engine
2017-03-07 16:01:21 +08:00
e7e6e755c3 Merge pull request #31450 from thaJeztah/fix-volume-force-remove
do not ignore "volume in use" errors when force-delete
Upstream-commit: 95cb74818a92de99b42c0c10f9ae4710c27357f4
Component: engine
2017-03-06 14:35:46 +01:00
d82df5d4ba 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>
Upstream-commit: f9bd8ec8b268581f93095c5a80679f0a8ff498bf
Component: engine
2017-03-03 16:33:34 -08:00
ac66308e6c Add support for rollback flags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 3a88a24d23e6eb1ca521cd9ab6e306d4ba1c1464
Component: engine
2017-03-03 16:33:34 -08:00
0c390668f1 Add support for the "rollback" failure action
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: cc9d04647a68cf49e66bf26f10908387b99dae1a
Component: engine
2017-03-03 16:33:34 -08:00
47709fd338 Merge pull request #31083 from xulike666/fight-for-readability
fix some typos from module contrib to man
Upstream-commit: 57fd478169071b09f0e6657cc1c2568d80c1bed3
Component: engine
2017-03-03 15:13:01 +01:00
d4d27bb5d4 Merge pull request #30725 from aaronlehmann/topology
Topology-aware scheduling
Upstream-commit: 3a5a1c3f3d1638c35891ee630ba20eda0bef560f
Component: engine
2017-03-03 15:01:12 +01:00
c09eedcd69 Merge pull request #30265 from allencloud/add-CheckDuplicate-details-and-logic
add CheckDuplicate docs and logics in network
Upstream-commit: e1da516598e6f4e8f58964fce62ff13be1d8cc09
Component: engine
2017-03-03 14:18:52 +01:00
f3bfd3cf98 Merge pull request #28279 from chchliang/updown
--max-concurrent-downloads,--max-concurrent-uploads must great than or equal to 0 
Upstream-commit: dc1b0e1b2c8483e0f2eaa28316be01aae6d6ae4a
Component: engine
2017-03-03 10:06:59 +01:00
fa769257a1 Merge pull request #31491 from rawkode/feature/healthchecks-missing-environment
Healthchecks should inherit environment
Upstream-commit: f4e82d71a8ec6aa2b03c213be7fb2a2ebd591ca7
Component: engine
2017-03-03 08:36:37 +01:00
302e2c7325 Merge pull request #31409 from yuexiao-wang/fix-version
'docker daemon' deprecation message doesn't use the new version
Upstream-commit: 55b955d9ffc14571fa6b5a1a6369a8be8d053853
Component: engine
2017-03-02 22:02:09 -05:00
31865190c5 'docker daemon' deprecation message doesn't use the new versioning scheme
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 5a9cee7bb57e7da7f2793fbb290498bba0531105
Component: engine
2017-03-03 17:26:49 +08:00
da34e724f8 Healthchecks should inherit environment
Signed-off-by: David McKay <david@rawkode.com>
Upstream-commit: 647dce9dea4aa56c919365b222e582749f1f7781
Component: engine
2017-03-02 16:23:56 +00:00
96de508a38 Merge pull request #31356 from coolljt0725/fix_suspend
devicemapper: Fix suspend a removed device
Upstream-commit: 3e561e4a845592b1c23cb6d13256694983066712
Component: engine
2017-03-02 10:11:48 +01:00
7860655b94 --max-concurrent-downloads,--max-concurrent-uploads must great than or equal to 0
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: e59af2abe692a1b16e8d11e2698714cf3d77d8c8
Component: engine
2017-03-02 09:23:01 +08:00
e79e000efa Merge pull request #30657 from madhanrm/ns1
Support --net=container:<NameOrID> for windows (Shared Pod Network)
Upstream-commit: 9358189fa38d046afffb81f367067db91c611fd5
Component: engine
2017-03-01 13:59:52 -08:00
2b8ba501aa Rather than remove the swarm directory and re-create, remove the swarm subdirs
Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: 68506bd23998cb229e05f70e3e923f64c43b2526
Component: engine
2017-03-01 11:56:39 -08:00
13f20b59db Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
Upstream-commit: bb9f19503cbb0153a0da01b1e91691cd63f48dd9
Component: engine
2017-03-01 18:10:57 +01:00
ab3f294aab 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>
Upstream-commit: 9d521a4d2fbbeec0f672b986e294fd5f1c4d2f32
Component: engine
2017-03-01 16:36:43 +01:00
3da961cb82 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>
Upstream-commit: 6e25bb2ed6560baec4b13930e673c88f1b49de34
Component: engine
2017-03-01 21:58:14 +08:00
709434a772 (*) 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>
Upstream-commit: 040afcce8f3f54c64d328929c5115128f623deb1
Component: engine
2017-02-28 20:03:43 -08:00
aeb62e6edf Merge pull request #31384 from allencloud/validate-extrahosts-in-deamon-side
validate extraHosts in daemon side
Upstream-commit: 40f390e67eead490fa0b8e1684fc2dc8528cd8c8
Component: engine
2017-02-28 18:28:10 +01:00
27f6b8793b 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>
Upstream-commit: 250e05e42773a875d2fb8248b94fa72f2934a4b6
Component: engine
2017-02-28 11:12:11 +01:00
922530d28e Refactor cpu-realtime file creation to remove duplication
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f7819fcb25aaf5b08202db275847c825e7b09999
Component: engine
2017-02-28 11:12:06 +01:00
df7fcfe4bc Reduce duplication in graphdriver
Removes some duplication in counter.go and proxy.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2028d8698d95fb73f0c59a548b8f2adbdf5057a4
Component: engine
2017-02-28 11:12:02 +01:00
7a647c8187 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>
Upstream-commit: cb6832c6d34cdce33341c4f71ba8f22a23608c70
Component: engine
2017-02-28 11:11:59 +01:00
8762483acd Refactor publish/expose filter to remove duplication
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: af0d9bdfe4a50c4c691e2939cb08dfb05dfa3688
Component: engine
2017-02-28 11:11:55 +01:00
f3e3af079e 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>
Upstream-commit: 12485d62eeba27119260dc5eb54ac4fa83c3130b
Component: engine
2017-02-28 11:11:48 +01:00
8b38b2a363 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>
Upstream-commit: a620c0172c6f11c538b27a26fdb3e5cdd3bf2ff9
Component: engine
2017-02-28 10:51:55 +01:00
e64cb1f6c5 Remove daemon.VXSubnets duplicate code
Refactor daemon.V4Subnets and daemon.V6Subnets to limit duplication

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3c5932086af51f57c497690ce3cf18a906b700cf
Component: engine
2017-02-28 10:51:40 +01:00
37a58aacb7 validate extraHosts in daemon side
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: d524dd95ccadf0b3dea2e04f5813abbc1423a84e
Component: engine
2017-02-28 10:37:59 +08:00
737f03c444 Topology-aware scheduling
This adds support for placement preferences in Swarm services.

- Convert PlacementPreferences between GRPC API and HTTP API
- Add --placement-pref, --placement-pref-add and --placement-pref-rm to CLI
- Add support for placement preferences in service inspect --pretty
- Add integration test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 17288c611a4f3f75ecb3bbb4533820b1836c55a6
Component: engine
2017-02-27 13:29:54 -08:00
458406a7f3 Merge pull request #31212 from fate-grand-order/fixed
use t.Fatal() to output the err message and fix typo
Upstream-commit: a6576b8a2bff0feeb67918403caa3df0c4c37673
Component: engine
2017-02-27 12:26:35 +09:00
1d2d461e40 Fix service logs API to be able to specify stream
Before this change, doing service logs was just tossing the stream
selectors and always using the default (both streams). This change adds
a check for which streams the user wants and only includes those.

Fixes #31306

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: f63c62ce70d6ed4706dbde43feb22c6004c32061
Component: engine
2017-02-23 15:09:09 -08:00
e252f084ae Merge pull request #31279 from aaronlehmann/shutdown-error-leakage
Shutdown leaks an error when the container was never started
Upstream-commit: 52ba250f7e1f504f2c984961fd7564cefec9c15e
Component: engine
2017-02-22 23:47:39 -08:00
3226daa36d Shutdown leaks an error when the container was never started
I found that sometimes tasks would end up in a rejected state when
trying to update them quickly. The problem was that Shutdown could fail
if called before the container was started. Instead of returning an
error in this case, Shutdown should succeed. This allows tasks to
progress to the "shutdown" state as expected.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 37b492ae1b2ba5f84cd0b795dbc68804d7b2fec5
Component: engine
2017-02-22 19:12:07 -08:00
9632b0f1e8 use t.Fatal() to output the err message where the values used for formatting
text does not appear to contain a placeholder

Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
Upstream-commit: 2a8d6368d4a930203b93f75914173ab65bf3b0bc
Component: engine
2017-02-23 10:16:22 +08:00