From a4ec5b48ecccfd2da5722e304137a8e68d40a30f Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 11 Jan 2016 12:05:28 -0800 Subject: [PATCH] Change missing image detection for create MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Daemon may not respond with the same image name any more but it may be in a normalized form. Generally checking for a container name doesn’t seem like a good idea because small image names may match any possible error. Signed-off-by: Tonis Tiigi --- client/container_create.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/container_create.go b/client/container_create.go index 1c35aaf..0f85e7b 100644 --- a/client/container_create.go +++ b/client/container_create.go @@ -33,13 +33,13 @@ func (cli *Client) ContainerCreate(config *container.Config, hostConfig *contain serverResp, err := cli.post("/containers/create", query, body, nil) if err != nil { - if serverResp != nil && serverResp.statusCode == 404 && strings.Contains(err.Error(), config.Image) { + if serverResp != nil && serverResp.statusCode == 404 && strings.Contains(err.Error(), "No such image") { return response, imageNotFoundError{config.Image} } return response, err } - if serverResp.statusCode == 404 && strings.Contains(err.Error(), config.Image) { + if serverResp.statusCode == 404 && strings.Contains(err.Error(), "No such image") { return response, imageNotFoundError{config.Image} }