// getExecExitCode perform an inspect on the exec command. It returns // the running state and the exit code. func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, execID string) (bool, int, error) { resp, err := client.ContainerExecInspect(ctx, execID) if err != nil { // If we can't connect, then the daemon probably died. if !apiclient.IsErrConnectionFailed(err) { return false, -1, err } return false, -1, nil } return resp.Running, resp.ExitCode, nil }