From a08156a072e10fb0130eb70aad832f63cf3d99c9 Mon Sep 17 00:00:00 2001 From: Reficul Date: Tue, 22 Nov 2016 10:42:55 +0800 Subject: [PATCH] fix incorrect ErrConnectFailed comparison Signed-off-by: Reficul Upstream-commit: 14770269e8527dae0510dc0146e50a0a59355d90 Component: cli --- components/cli/command/container/exec.go | 2 +- components/cli/command/container/utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/command/container/exec.go b/components/cli/command/container/exec.go index 4bc8c58066..f0381494e2 100644 --- a/components/cli/command/container/exec.go +++ b/components/cli/command/container/exec.go @@ -170,7 +170,7 @@ func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, e resp, err := client.ContainerExecInspect(ctx, execID) if err != nil { // If we can't connect, then the daemon probably died. - if err != apiclient.ErrConnectionFailed { + if !apiclient.IsErrConnectionFailed(err) { return false, -1, err } return false, -1, nil diff --git a/components/cli/command/container/utils.go b/components/cli/command/container/utils.go index 6161e07140..f42a8def10 100644 --- a/components/cli/command/container/utils.go +++ b/components/cli/command/container/utils.go @@ -91,7 +91,7 @@ func getExitCode(ctx context.Context, dockerCli *command.DockerCli, containerID c, err := dockerCli.Client().ContainerInspect(ctx, containerID) if err != nil { // If we can't connect, then the daemon probably died. - if err != clientapi.ErrConnectionFailed { + if !clientapi.IsErrConnectionFailed(err) { return false, -1, err } return false, -1, nil