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

Add capability filter to docker plugin ls

This fix adds `--filter capability=[volumedriver|authz]` to `docker plugin ls`.

The related docs has been updated.

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2016-11-23 05:27:09 -08:00
parent a66e0dc349
commit 99d91ada97
5 changed files with 70 additions and 3 deletions

View file

@ -313,3 +313,30 @@ func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *check.C) {
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, pName)
}
func (s *DockerDaemonSuite) TestPluginListFilterCapability(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", "capability=volumedriver")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, pName)
out, err = s.d.Cmd("plugin", "ls", "--filter", "capability=authz")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Not(checker.Contains), pName)
out, err = s.d.Cmd("plugin", "ls")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, pName)
}