From e57900a2695165bda111758e931e7c3c38449a9f Mon Sep 17 00:00:00 2001 From: Dave MacDonald Date: Sun, 3 Apr 2016 16:25:07 -0400 Subject: [PATCH] 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 --- distribution/push.go | 2 +- integration-cli/docker_cli_push_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution/push.go b/distribution/push.go index 52ee8e77e2..fffbc56e42 100644 --- a/distribution/push.go +++ b/distribution/push.go @@ -109,7 +109,7 @@ func Push(ctx context.Context, ref reference.Named, imagePushConfig *ImagePushCo associations := imagePushConfig.ReferenceStore.ReferencesByName(repoInfo) if len(associations) == 0 { - return fmt.Errorf("Repository does not exist: %s", repoInfo.Name()) + return fmt.Errorf("An image does not exist locally with the tag: %s", repoInfo.Name()) } var ( diff --git a/integration-cli/docker_cli_push_test.go b/integration-cli/docker_cli_push_test.go index 6b3d8232cc..2e2f23177f 100644 --- a/integration-cli/docker_cli_push_test.go +++ b/integration-cli/docker_cli_push_test.go @@ -43,7 +43,7 @@ func (s *DockerSuite) TestPushUnprefixedRepo(c *check.C) { func testPushUntagged(c *check.C) { repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL) - expected := "Repository does not exist" + expected := "An image does not exist locally with the tag" out, _, err := dockerCmdWithError("push", repoName) c.Assert(err, check.NotNil, check.Commentf("pushing the image to the private registry should have failed: output %q", out))