Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 3cd39aaeab37102e4b12decc0c36042e477e2fa6)
Signed-off-by: Victor Vieux <vieux@docker.com>
| ... | ... |
@@ -456,3 +456,11 @@ func (s *DockerSuite) TestInspectUnknownObject(c *check.C) {
|
| 456 | 456 |
c.Assert(out, checker.Contains, "Error: No such object: foobar") |
| 457 | 457 |
c.Assert(err.Error(), checker.Contains, "Error: No such object: foobar") |
| 458 | 458 |
} |
| 459 |
+ |
|
| 460 |
+func (s *DockerSuite) TestInpectInvalidReference(c *check.C) {
|
|
| 461 |
+ // This test should work on both Windows and Linux |
|
| 462 |
+ out, _, err := dockerCmdWithError("inspect", "FooBar")
|
|
| 463 |
+ c.Assert(err, checker.NotNil) |
|
| 464 |
+ c.Assert(out, checker.Contains, "Error: No such object: FooBar") |
|
| 465 |
+ c.Assert(err.Error(), checker.Contains, "Error: No such object: FooBar") |
|
| 466 |
+} |
| ... | ... |
@@ -227,7 +227,7 @@ func (ps *Store) resolvePluginID(idOrName string) (string, error) {
|
| 227 | 227 |
|
| 228 | 228 |
ref, err := reference.ParseNamed(idOrName) |
| 229 | 229 |
if err != nil {
|
| 230 |
- return "", errors.Wrapf(err, "failed to parse %v", idOrName) |
|
| 230 |
+ return "", errors.WithStack(ErrNotFound(idOrName)) |
|
| 231 | 231 |
} |
| 232 | 232 |
if _, ok := ref.(reference.Canonical); ok {
|
| 233 | 233 |
logrus.Warnf("canonical references cannot be resolved: %v", ref.String())
|