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

Migrate network command to cobra

- Migrates network command and subcommands (connect, create, disconnect,
  inspect, list and remove) to spf13/cobra
- Create a RequiredExactArgs helper function for command that require an
  exact number of arguments.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester
2016-06-06 10:28:52 +02:00
parent 28dde09cdf
commit 4bd202b00f
14 changed files with 581 additions and 438 deletions

View File

@@ -379,7 +379,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkCreateLabel(c *check.C) {
dockerCmd(c, "network", "create", "--label", testLabel+"="+testValue, testNet)
assertNwIsAvailable(c, testNet)
out, _, err := dockerCmdWithError("network", "inspect", "--format='{{ .Labels."+testLabel+" }}'", testNet)
out, _, err := dockerCmdWithError("network", "inspect", "--format={{ .Labels."+testLabel+" }}", testNet)
c.Assert(err, check.IsNil)
c.Assert(strings.TrimSpace(out), check.Equals, testValue)
@@ -423,7 +423,7 @@ func (s *DockerSuite) TestDockerNetworkInspect(c *check.C) {
c.Assert(err, check.IsNil)
c.Assert(networkResources, checker.HasLen, 1)
out, _ = dockerCmd(c, "network", "inspect", "--format='{{ .Name }}'", "host")
out, _ = dockerCmd(c, "network", "inspect", "--format={{ .Name }}", "host")
c.Assert(strings.TrimSpace(out), check.Equals, "host")
}