summaryrefslogtreecommitdiff
path: root/integration-cli/docker_cli_inspect_test.go
diff options
context:
space:
mode:
authorYong Tang <yong.tang.github@outlook.com>2016-12-06 10:29:48 -0800
committerYong Tang <yong.tang.github@outlook.com>2016-12-06 12:05:59 -0800
commit88fcdb0a825da040ef2b1f9c191af480f0f2cc90 (patch)
tree436b5c9301c7c66047a456845fee559a2e9c3043 /integration-cli/docker_cli_inspect_test.go
parenteefbf1ddd3ee4e6b6e6dc7e938e77a96ceb40163 (diff)
downloaddocker-88fcdb0a825da040ef2b1f9c191af480f0f2cc90.tar.gz
Fix `docker inspect <unkown object>` issue on Windows
This fix tries to address the issue raised on 29185 where `docker inspect <unknown object>` on Windows will return: ``` Error response from daemon: plugins are not supported on this platform ``` The reason was that in case `--type` is not specified, `docker inspect` will iterate through different types `container`, `image`, `network`, `plugin` etc. The `plugin` object is the last type to check. However, as `plugin` is not supported on Windows yet, the error message is not very informative for `plugins are not supported on this platform`. This fix tries to fix the issue by return a `not found` error on unsupported platforms as well. An integration test has been added to cover the changes for Windows/Linux. This fix fixes 29185. 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.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go
index 5d79ad1d85..2f2a918f0f 100644
--- a/integration-cli/docker_cli_inspect_test.go
+++ b/integration-cli/docker_cli_inspect_test.go
@@ -447,3 +447,12 @@ func (s *DockerSuite) TestInspectPlugin(c *check.C) {
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, pNameWithTag)
}
+
+// Test case for 29185
+func (s *DockerSuite) TestInspectUnknownObject(c *check.C) {
+ // This test should work on both Windows and Linux
+ out, _, err := dockerCmdWithError("inspect", "foobar")
+ c.Assert(err, checker.NotNil)
+ c.Assert(out, checker.Contains, "Error: No such object: foobar")
+ c.Assert(err.Error(), checker.Contains, "Error: No such object: foobar")
+}