diff options
author | Yong Tang <yong.tang.github@outlook.com> | 2016-11-29 17:31:29 -0800 |
---|---|---|
committer | Yong Tang <yong.tang.github@outlook.com> | 2016-12-02 11:33:29 -0800 |
commit | 90bb2cdb9f15a9b1b9a4e2ea4242882665daac4e (patch) | |
tree | e08214d907cee45656219b31a13f4ac3fef9a0b8 /integration-cli/docker_cli_inspect_test.go | |
parent | bed5a0bc2c972243205cf18f30389d47a31537c0 (diff) | |
download | docker-90bb2cdb9f15a9b1b9a4e2ea4242882665daac4e.tar.gz |
Support plugins in `docker inspect`
This fix tries to address the proposal raised in 28946
to support plugins in `docker inspect`.
The command `docker inspect` already supports
"container", "image", "node", "network", "service", "volume", "task".
However, `--type plugin` is not supported yet at the moment.
This fix address this issue by adding the support of `--type plugin`
for `docker inspect`.
An additional integration test has been added to cover the changes.
This fix fixes 28946.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'integration-cli/docker_cli_inspect_test.go')
-rw-r--r-- | integration-cli/docker_cli_inspect_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index d99ae6d091..5d79ad1d85 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -417,3 +417,33 @@ func (s *DockerSuite) TestInspectAmpersand(c *check.C) { out, _ = dockerCmd(c, "inspect", name) c.Assert(out, checker.Contains, `soanni&rtr`) } + +func (s *DockerSuite) TestInspectPlugin(c *check.C) { + testRequires(c, DaemonIsLinux, Network) + _, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag) + c.Assert(err, checker.IsNil) + + out, _, err := dockerCmdWithError("inspect", "--type", "plugin", "--format", "{{.Name}}", pNameWithTag) + c.Assert(err, checker.IsNil) + c.Assert(strings.TrimSpace(out), checker.Equals, pName) + + out, _, err = dockerCmdWithError("inspect", "--format", "{{.Name}}", pNameWithTag) + c.Assert(err, checker.IsNil) + c.Assert(strings.TrimSpace(out), checker.Equals, pName) + + // Even without tag the inspect still work + out, _, err = dockerCmdWithError("inspect", "--type", "plugin", "--format", "{{.Name}}", pName) + c.Assert(err, checker.IsNil) + c.Assert(strings.TrimSpace(out), checker.Equals, pName) + + out, _, err = dockerCmdWithError("inspect", "--format", "{{.Name}}", pName) + c.Assert(err, checker.IsNil) + c.Assert(strings.TrimSpace(out), checker.Equals, pName) + + _, _, err = dockerCmdWithError("plugin", "disable", pNameWithTag) + c.Assert(err, checker.IsNil) + + out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag) + c.Assert(err, checker.IsNil) + c.Assert(out, checker.Contains, pNameWithTag) +} |