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

Add "driver" filter for network ls

This add a new filter to 'docker network ls'
to allow filtering by driver-name.

Contrary to "ID" and "name" filters, this
filter only supports an *exact* match.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2016-04-25 22:21:11 +02:00
parent 24a8de2b60
commit 23e418b6c9
7 changed files with 59 additions and 10 deletions

View File

@@ -352,6 +352,15 @@ func (s *DockerNetworkSuite) TestDockerNetworkLsFilter(c *check.C) {
out, _ = dockerCmd(c, "network", "ls", "-f", "label=nonexistent")
outArr := strings.Split(strings.TrimSpace(out), "\n")
c.Assert(len(outArr), check.Equals, 1, check.Commentf("%s\n", out))
out, _ = dockerCmd(c, "network", "ls", "-f", "driver=null")
assertNwList(c, out, []string{"none"})
out, _ = dockerCmd(c, "network", "ls", "-f", "driver=host")
assertNwList(c, out, []string{"host"})
out, _ = dockerCmd(c, "network", "ls", "-f", "driver=bridge")
assertNwList(c, out, []string{"bridge", "dev", testNet})
}
func (s *DockerNetworkSuite) TestDockerNetworkCreateDelete(c *check.C) {