Commit graph

4793 commits

Author SHA1 Message Date
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
Akihiro Suda
a6576b8a2b Merge pull request #31212 from fate-grand-order/fixed
use t.Fatal() to output the err message and fix typo
2017-02-27 12:26:35 +09:00
Drew Erny
f63c62ce70 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>
2017-02-23 15:09:09 -08:00
Victor Vieux
52ba250f7e Merge pull request #31279 from aaronlehmann/shutdown-error-leakage
Shutdown leaks an error when the container was never started
2017-02-22 23:47:39 -08:00
Aaron Lehmann
37b492ae1b 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>
2017-02-22 19:12:07 -08:00
fate-grand-order
2a8d6368d4 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>
2017-02-23 10:16:22 +08:00
Alexander Morozov
b3e7f70137 Merge pull request #31263 from nalind/journal-doublefree
Synchronize the cursor returned by followJournal
2017-02-22 17:45:49 -08:00
Victor Vieux
f67eb69fe3 Merge pull request #31231 from mlaventure/fix-journald-invalid-free
Prevent freeing a possible invalid pointer from journald
2017-02-22 15:36:36 -08:00
Nalin Dahyabhai
d57c330617 Synchronize the cursor returned by followJournal
Make sure that the cursor value returned by followJournal() is the last
of the values returned by its goroutine's calls to drainJournal() by
waiting for it, rather than returning a value that may be superceded by
another if we're singalling the goroutine that it should exit by closing
a pipe.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-22 16:22:00 -05:00
Kenfe-Mickael Laventure
81630df854 Prevent freeing a possible invalid pointer from journald
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-02-22 07:54:10 -08:00
Lei Jitang
ffc70d2f0c Merge pull request #31211 from lixiaobing10051267/masterAttach
invalide detach keys provided
2017-02-22 11:28:15 +08:00
lixiaobing10051267
660ec32e8f invalide detach keys provided
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-02-22 09:48:18 +08:00
Alexander Morozov
1ad165dba1 Merge pull request #31136 from tonistiigi/more-locks
Add more locking to storage drivers
2017-02-21 07:39:33 -08:00
Vincent Demeester
91cffdbedb Merge pull request #31159 from tonistiigi/fix-size-lock
Don’t hold container lock for size calculation
2017-02-19 16:31:21 +01:00
Tonis Tiigi
bd33a99acf Don’t hold container lock for size calculation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-02-18 18:11:48 -08:00
Victor Vieux
7761c69e23 Merge pull request #31055 from Microsoft/jjh/fix30278
Windows: Retry workaround for RS1/RS2 compute system enumeration
2017-02-17 16:53:16 -08:00
Tonis Tiigi
fc1cf1911b Add more locking to storage drivers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-02-17 15:50:25 -08:00
Victor Vieux
cf5fe9ed0b Merge pull request #31075 from vieux/switch_to_new_versioning_scheme
Switch to new versioning scheme
2017-02-17 15:43:28 -08:00
Anusha Ragunathan
6dd2a82458 Merge pull request #29984 from jmzwcn/issueNNP
[feature]: add daemon flag to set no_new_priv as default for unprivileged containers
2017-02-17 11:43:43 -08:00
Alexander Morozov
0de867b315 Merge pull request #30967 from adshmh/24631-service-without-labels-returns-empty-map
Inspect output on service without labels is an empty map instead of null, fixes #24631
2017-02-17 08:49:32 -08:00
Vincent Demeester
146bc072a9 Merge pull request #31069 from tonistiigi/fix-overlay2-unmount
overlay2: fix unmounting layer without merge dir
2017-02-17 10:21:47 +01:00
Vincent Demeester
e1839ab953 Merge pull request #31103 from tonistiigi/update-docs-link
Update storage driver options link
2017-02-17 09:45:31 +01:00
Tonis Tiigi
e9864cc0ec Update storage driver options link
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-02-16 18:32:17 -08:00
Brian Goff
7978eef623 Merge pull request #30618 from cpuguy83/fix_data_races
Fix some data races
2017-02-16 21:15:21 -05:00
Brian Goff
39851eac0c Merge pull request #31070 from cpuguy83/31060_fix_log_read_spin
Fix cpu spin waiting for log write events
2017-02-16 20:15:38 -05:00
Brian Goff
7f0b833621 Merge pull request #31054 from darrenstahlmsft/WaitOOBE
Windows: Wait for OOBE to prevent crashing during host update
2017-02-16 11:18:25 -05:00
Vincent Demeester
55e2ed2a65 Merge pull request #31073 from aboch/naip
Release the network attachment on allocation failure
2017-02-16 16:36:28 +01:00
Alessandro Boch
91820b6941 Release the network attachment on allocation failure
- otherwise the attachment task will stay in store and
  consume IP addresses and there is no way to remove it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-16 05:21:06 -08:00
Daniel Zhang
d7fda019bb Add daemon flag to set no_new_priv as default for unprivileged containers.
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2017-02-16 19:05:14 +08:00
Victor Vieux
47396d6377 Switch to new versioning scheme
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-15 23:22:50 -08:00
Brian Goff
7a179972ff Fix cpu spin waiting for log write events
This loop is not ever going to return since it's never actually setting
the `err` var except on the first iteration.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-15 21:41:32 -05:00
Tonis Tiigi
e1af6c8a57 overlay2: fix unmounting layer without merge dir
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-02-15 17:58:12 -08:00
Darren Stahl
e128a65685 Windows: Wait for OOBE to prevent crashing during host update
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-02-15 14:01:54 -08:00
John Howard
83a2db2097 Windows: Retry loop to fix HCS race condition enumerating containers
Signed-off-by: John Howard <jhoward@microsoft.com>

This fixes https://github.com/docker/docker/issues/30278 where
there is a race condition in HCS for RS1 and RS2 builds, and enumeration
of compute systems can return access is denied if a silo is being
torn down in the kernel while HCS is attempting to enumerate them.
2017-02-15 11:16:24 -08:00
allencloud
75f5d63ec8 rewrite reload code
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-15 21:57:27 +08:00
Arash Deshmeh
1b347cfc79 Fixing #24631, inspect output on swarm object types without labels is empty object {}
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-02-15 01:25:55 -05:00
bingshen.wbs
51870c7e92 fix docker daemon reload bug
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2017-02-15 10:58:09 +08:00
Alexander Morozov
22472c8be5 Merge pull request #29702 from WeiZhang555/stats-all-format-name-panic
Send "Name" and "ID" when stating stopped containers
2017-02-14 10:48:42 -08:00
Akihiro Suda
eac68dbbbc Merge pull request #30340 from ijrandom/master
Fix #30311: dockerd leaks ExecIds on failed exec -i
2017-02-14 10:13:16 +09:00
Aaron Lehmann
b8a3595941 Merge pull request #30834 from allencloud/refactor-daemon-cluster-handler-and-helper
refactor cluster/helper.go and split cluster.go into multiple files
2017-02-13 11:31:30 -08:00
allencloud
75a315d43e create a new file swarm.go and move swarm part code from cluster.go into swarm.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-12 02:54:07 +08:00
allencloud
4f4151bba4 create a new file networks.go and move network part codes from cluster.go into networks.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-12 02:50:17 +08:00
allencloud
6be675c752 create a new file task.go and move task part codes from cluster.go into tasks.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-12 02:45:00 +08:00
allencloud
6ff14b48c7 create a new file services.go and move service part codes from cluster.go into services.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-12 02:43:23 +08:00
allencloud
7591e313a4 create a new file nodes.go and move node part codes from cluster.go into nodes.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-12 02:36:09 +08:00
allencloud
b6fb3a56dc refactor helper.go and move getSecret to helper.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-02-12 02:30:53 +08:00