mirror of
https://github.com/docker/cli.git
synced 2026-09-27 01:40:31 -04:00
Fix docker plugin inspect <unkown object> issue on Windows
This fix is a follow up for comment: https://github.com/docker/docker/pull/29186/files#r91277345 While #29186 addresses the issue of `docker inspect <unknown object>` on Windows, it actually makes `docker plugin inspect <unknown object>` out `object not found` on Windows as well. This is actually misleading as plugin is not supported on Windows. This fix reverted the change in #29186 while at the same time, checks `not supported` in `docker inspect <unknown object>` so that - `docker plugin inspect <unknown object>` returns `not supported` on Windows - `docker inspect <unknown object>` returns `not found` on Windows This fix is related to #29186 and #29185. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 0b3c10ac4ddfe3655bac080440a8553269f2307f Component: engine
This commit is contained in:
@@ -251,3 +251,14 @@ func (s *DockerSuite) TestPluginInspect(c *check.C) {
|
||||
_, _, err = dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", id[:5])
|
||||
c.Assert(err, checker.NotNil)
|
||||
}
|
||||
|
||||
// Test case for https://github.com/docker/docker/pull/29186#discussion_r91277345
|
||||
func (s *DockerSuite) TestPluginInspectOnWindows(c *check.C) {
|
||||
// This test should work on Windows only
|
||||
testRequires(c, DaemonIsWindows)
|
||||
|
||||
out, _, err := dockerCmdWithError("plugin", "inspect", "foobar")
|
||||
c.Assert(err, checker.NotNil)
|
||||
c.Assert(out, checker.Contains, "plugins are not supported on this platform")
|
||||
c.Assert(err.Error(), checker.Contains, "plugins are not supported on this platform")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user