1
0
mirror of https://github.com/moby/moby.git synced 2025-10-24 09:13:09 +03:00

Forced endpoint cleanup

docker's network disconnect api now supports `Force` option which can be
used to force cleanup an endpoint from any host in the cluster.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal
2016-01-12 20:56:36 -08:00
parent 742a7d53f2
commit b464f1d78c
11 changed files with 62 additions and 10 deletions

View File

@@ -448,6 +448,22 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnect(c *check.C) {
c.Assert(nr.Name, checker.Equals, "test")
c.Assert(len(nr.Containers), checker.Equals, 0)
// run another container
out, _ = dockerCmd(c, "run", "-d", "--net", "test", "--name", "test2", "busybox", "top")
c.Assert(waitRun("test2"), check.IsNil)
containerID = strings.TrimSpace(out)
nr = getNwResource(c, "test")
c.Assert(nr.Name, checker.Equals, "test")
c.Assert(len(nr.Containers), checker.Equals, 1)
// force disconnect the container to the test network
dockerCmd(c, "network", "disconnect", "-f", "test", containerID)
nr = getNwResource(c, "test")
c.Assert(nr.Name, checker.Equals, "test")
c.Assert(len(nr.Containers), checker.Equals, 0)
dockerCmd(c, "network", "rm", "test")
assertNwNotAvailable(c, "test")
}