Browse code

Improved message when pushing a non-existant image

The prior error message caused confusion. If a user attempts to push an
image up to a registry, but they misspelled (or forgot to properly tag
their image) they would see the message 'Repository does not exist', which
is not very clear and causes some to think that there might be a problem
with the registry or connectivity to it, when the problem was simply just
that an image with that tag specified does not exist locally.

Signed-off-by: Dave MacDonald <mindlapse@gmail.com>

Dave MacDonald authored on 2016/04/04 05:25:07
Showing 2 changed files
... ...
@@ -109,7 +109,7 @@ func Push(ctx context.Context, ref reference.Named, imagePushConfig *ImagePushCo
109 109
 
110 110
 	associations := imagePushConfig.ReferenceStore.ReferencesByName(repoInfo)
111 111
 	if len(associations) == 0 {
112
-		return fmt.Errorf("Repository does not exist: %s", repoInfo.Name())
112
+		return fmt.Errorf("An image does not exist locally with the tag: %s", repoInfo.Name())
113 113
 	}
114 114
 
115 115
 	var (
... ...
@@ -43,7 +43,7 @@ func (s *DockerSuite) TestPushUnprefixedRepo(c *check.C) {
43 43
 
44 44
 func testPushUntagged(c *check.C) {
45 45
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
46
-	expected := "Repository does not exist"
46
+	expected := "An image does not exist locally with the tag"
47 47
 
48 48
 	out, _, err := dockerCmdWithError("push", repoName)
49 49
 	c.Assert(err, check.NotNil, check.Commentf("pushing the image to the private registry should have failed: output %q", out))