зеркало из https://github.com/microsoft/docker.git
Fix inspect object by invalid reference
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Родитель
a9fa38b1ed
Коммит
3cd39aaeab
|
@ -456,3 +456,11 @@ func (s *DockerSuite) TestInspectUnknownObject(c *check.C) {
|
|||
c.Assert(out, checker.Contains, "Error: No such object: foobar")
|
||||
c.Assert(err.Error(), checker.Contains, "Error: No such object: foobar")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestInpectInvalidReference(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")
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ func (ps *Store) resolvePluginID(idOrName string) (string, error) {
|
|||
|
||||
ref, err := reference.ParseNamed(idOrName)
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "failed to parse %v", idOrName)
|
||||
return "", errors.WithStack(ErrNotFound(idOrName))
|
||||
}
|
||||
if _, ok := ref.(reference.Canonical); ok {
|
||||
logrus.Warnf("canonical references cannot be resolved: %v", ref.String())
|
||||
|
|
Загрузка…
Ссылка в новой задаче