1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add --filter enabled=true for docker plugin ls

This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2016-11-23 04:58:15 -08:00
parent 541150da53
commit a66e0dc349
11 changed files with 174 additions and 38 deletions

View file

@ -285,3 +285,31 @@ func existsMountpointWithPrefix(mountpointPrefix string) (bool, error) {
}
return false, nil
}
func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *check.C) {
testRequires(c, Network)
s.d.Start(c)
out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pNameWithTag, "--disable")
c.Assert(err, check.IsNil, check.Commentf(out))
defer func() {
if out, err := s.d.Cmd("plugin", "remove", pNameWithTag); err != nil {
c.Fatalf("Could not remove plugin: %v %s", err, out)
}
}()
out, err = s.d.Cmd("plugin", "ls", "--filter", "enabled=true")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Not(checker.Contains), pName)
out, err = s.d.Cmd("plugin", "ls", "--filter", "enabled=false")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, pName)
c.Assert(out, checker.Contains, "false")
out, err = s.d.Cmd("plugin", "ls")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, pName)
}