From aa9c9569c29e3696c9427d2d66341c95fe076e4f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Dec 2014 09:59:08 +0100 Subject: [PATCH] Improve error message for conflicting container name. This changes the error message that is returned by the daemon when a container-name already exists. The old message suggests that containers can be renamed, which is currently not possible. To prevent confusion, the part "(or rename)" is removed from the error-message. Message before this change; FATA[0000] Error response from daemon: Conflict, The name foobar is already assigned to 728ac36fb0ab. You have to delete (or rename) that container to be able to assign foobar to a container again. Message after this change; FATA[0000] Error response from daemon: Conflict. The name 'foobar' is already in use by container 728ac36fb0ab. You have to delete that container to be able to reuse that name. Relates to: https://github.com/docker/docker/issues/3036 Signed-off-by: Sebastiaan van Stijn --- daemon/daemon.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 1553f198d..632b9abc4 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -478,8 +478,8 @@ func (daemon *Daemon) reserveName(id, name string) (string, error) { } else { nameAsKnownByUser := strings.TrimPrefix(name, "/") return "", fmt.Errorf( - "Conflict, The name %s is already assigned to %s. You have to delete (or rename) that container to be able to assign %s to a container again.", nameAsKnownByUser, - utils.TruncateID(conflictingContainer.ID), nameAsKnownByUser) + "Conflict. The name %q is already in use by container %s. You have to delete that container to be able to reuse that name.", nameAsKnownByUser, + utils.TruncateID(conflictingContainer.ID)) } } return name, nil