зеркало из https://github.com/docker/engine-api.git
Change missing image detection for create
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 <tonistiigi@gmail.com>
This commit is contained in:
Родитель
259fce04b5
Коммит
a4ec5b48ec
|
@ -33,13 +33,13 @@ func (cli *Client) ContainerCreate(config *container.Config, hostConfig *contain
|
||||||
|
|
||||||
serverResp, err := cli.post("/containers/create", query, body, nil)
|
serverResp, err := cli.post("/containers/create", query, body, nil)
|
||||||
if err != 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, imageNotFoundError{config.Image}
|
||||||
}
|
}
|
||||||
return response, err
|
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}
|
return response, imageNotFoundError{config.Image}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче