mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
client.ContainerWait(): don't send empty "condition" query parameter
The client would always send a value, even if no `condition` was set; Calling POST /v1.41/containers/foo/wait?condition= This patch changes the client to not send the parameter if it's empty (and the API default value should be used). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
5e2b7dea02
commit
a832635e51
1 changed files with 3 additions and 1 deletions
|
@ -33,7 +33,9 @@ func (cli *Client) ContainerWait(ctx context.Context, containerID string, condit
|
|||
errC := make(chan error, 1)
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("condition", string(condition))
|
||||
if condition != "" {
|
||||
query.Set("condition", string(condition))
|
||||
}
|
||||
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/wait", query, nil, nil)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue