diff options
| author | Sebastiaan van Stijn <github@gone.nl> | 2022-02-11 22:54:20 +0100 |
|---|---|---|
| committer | Sebastiaan van Stijn <github@gone.nl> | 2022-02-14 21:47:53 +0100 |
| commit | a832635e5135eb82fe6cd0698f533ae9426eeb40 (patch) | |
| tree | 95e0eaee85b735054dbe8bb77f7f57d6b38e3496 /client | |
| parent | 5e2b7dea02e880ec5b8220251230409094345ff1 (diff) | |
| download | docker-a832635e5135eb82fe6cd0698f533ae9426eeb40.tar.gz | |
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>
Diffstat (limited to 'client')
| -rw-r--r-- | client/container_wait.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/container_wait.go b/client/container_wait.go index 6ab8c1da96..e9b134c9d2 100644 --- a/client/container_wait.go +++ b/client/container_wait.go @@ -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 { |
