1
0
mirror of https://github.com/moby/moby.git synced 2025-10-25 20:38:05 +03:00

Rename --net to --network

Add a `--network` flag which replaces `--net` without deprecating it
yet. The `--net` flag remains hidden and supported.

Add a `--network-alias` flag which replaces `--net-alias` without deprecating
it yet. The `--net-alias` flag remains hidden and supported.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie (icecrime)
2016-06-06 16:33:00 -07:00
parent 5b21c8a408
commit c0c7d5e715
18 changed files with 72 additions and 54 deletions

View File

@@ -1660,3 +1660,15 @@ func (s *DockerDaemonSuite) TestDaemonRestartRestoreBridgeNetwork(t *check.C) {
t.Fatal(err)
}
}
func (s *DockerNetworkSuite) TestDockerNetworkFlagAlias(c *check.C) {
dockerCmd(c, "network", "create", "user")
output, status := dockerCmd(c, "run", "--rm", "--network=user", "--network-alias=foo", "busybox", "true")
c.Assert(status, checker.Equals, 0, check.Commentf("unexpected status code %d (%s)", status, output))
output, status, _ = dockerCmdWithError("run", "--rm", "--net=user", "--network=user", "busybox", "true")
c.Assert(status, checker.Equals, 0, check.Commentf("unexpected status code %d (%s)", status, output))
output, status, _ = dockerCmdWithError("run", "--rm", "--network=user", "--net-alias=foo", "--network-alias=bar", "busybox", "true")
c.Assert(status, checker.Equals, 0, check.Commentf("unexpected status code %d (%s)", status, output))
}