docker: ignore "connection reset by peer"
The Docker agent closes the connection during read after we have read the body. This causes a "connection reset by peer" even though the command was successful. We ignore that error here since we got the correct status code and a response body.
This commit is contained in:
parent
17213f6e8f
commit
b907c4611d
|
@ -155,7 +155,7 @@ func (c *DockerClient) StartExec(containerID, execID string) (*circbuf.Buffer, e
|
||||||
uri := fmt.Sprintf("/exec/%s/start", execID)
|
uri := fmt.Sprintf("/exec/%s/start", execID)
|
||||||
b, code, err := c.call("POST", uri, data)
|
b, code, err := c.call("POST", uri, data)
|
||||||
switch {
|
switch {
|
||||||
case err != nil:
|
case err != nil && !strings.Contains(err.Error(), "connection reset by peer"):
|
||||||
return nil, fmt.Errorf("start exec failed for container %s: %s", containerID, err)
|
return nil, fmt.Errorf("start exec failed for container %s: %s", containerID, err)
|
||||||
case code == 200:
|
case code == 200:
|
||||||
return b, nil
|
return b, nil
|
||||||
|
|
Loading…
Reference in New Issue