Skip to content

Commit

Permalink
Improved message when pushing a non-existant image
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mindlapse committed Apr 3, 2016
1 parent 8eb8a1d commit e57900a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion distribution/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e57900a

Please sign in to comment.