From 77c5668baf30dabbdee30284a4b285163b042cf3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 31 Dec 2018 18:33:23 +0100 Subject: [PATCH] client: remove special error handling for "no such image" looks like we don't need this handling Before this patch: Error: No such image: nosuchimage After this patch: Error response from daemon: No such image: nosuchimage:latest " Signed-off-by: Sebastiaan van Stijn --- client/container_create.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/container_create.go b/client/container_create.go index d269a61894..3c9e9c55b7 100644 --- a/client/container_create.go +++ b/client/container_create.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "net/url" - "strings" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" @@ -44,9 +43,6 @@ func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config serverResp, err := cli.post(ctx, "/containers/create", query, body, nil) if err != nil { - if serverResp.statusCode == 404 && strings.Contains(err.Error(), "No such image") { - return response, objectNotFoundError{object: "image", id: config.Image} - } return response, err }