Browse code

Remove deadlock in ContainerWait

when `cli.post(...)` fails `errC <- err` blocks because `errC` is unbufferd.

Signed-off-by: Simon Menke <simon.menke@gmail.com>

Simon Menke authored on 2017/05/19 15:40:58
Showing 1 changed files
... ...
@@ -31,7 +31,7 @@ func (cli *Client) ContainerWait(ctx context.Context, containerID string, condit
31 31
 	}
32 32
 
33 33
 	resultC := make(chan container.ContainerWaitOKBody)
34
-	errC := make(chan error)
34
+	errC := make(chan error, 1)
35 35
 
36 36
 	query := url.Values{}
37 37
 	query.Set("condition", string(condition))