ソースを参照

Improve message when pushing a non-existent image

I was confused earlier when I did:

```
docker push localhost.localdomain:1234/foo
```

Because docker told me:

```
No such id: localhost.localdomain:1234/foo
```

I actually had buried in my mind the solution to this, but the error
message
confused me because I had recently had some fun trying to get the
registry
working and therefore thought it was telling me that I didn't have an
account
on the registry.

This pull request makes it unambiguous that the error is that the
specified
image is unknown.

/cc @cpuguy83

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
Peter Waller 10 年 前
コミット
3a08bbc4d2
1 ファイル変更1 行追加1 行削除
  1. 1 1
      graph/graph.go

+ 1 - 1
graph/graph.go

@@ -88,7 +88,7 @@ func (graph *Graph) Exists(id string) bool {
 func (graph *Graph) Get(name string) (*image.Image, error) {
 	id, err := graph.idIndex.Get(name)
 	if err != nil {
-		return nil, err
+		return nil, fmt.Errorf("could not find image: %v", err)
 	}
 	img, err := image.LoadImage(graph.ImageRoot(id))
 	if err != nil {