1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/types
Kir Kolyshkin f963500c54 ContainerWait on remove: don't stuck on rm fail
Currently, if a container removal has failed for some reason,
any client waiting for removal (e.g. `docker run --rm`) is
stuck, waiting for removal to succeed while it has failed already.
For more details and the reproducer, please check
https://github.com/moby/moby/issues/34945

This commit addresses that by allowing `ContainerWait()` with
`container.WaitCondition == "removed"` argument to return an
error in case of removal failure. The `ContainerWaitOKBody`
stucture returned to a client is amended with a pointer to `struct Error`,
containing an error message string, and the `Client.ContainerWait()`
is modified to return the error, if any, to the client.

Note that this feature is only available for API version >= 1.34.
In order for the old clients to be unstuck, we just close the connection
without writing anything -- this causes client's error.

Now, docker-cli would need a separate commit to bump the API to 1.34
and to show an error returned, if any.

[v2: recreate the waitRemove channel after closing]
[v3: document; keep legacy behavior for older clients]
[v4: convert Error from string to pointer to a struct]
[v5: don't emulate old behavior, send empty response in error case]
[v6: rename legacy* vars to include version suffix]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-10-25 13:11:56 -07:00
..
backend LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
blkiodev
container ContainerWait on remove: don't stuck on rm fail 2017-10-25 13:11:56 -07:00
events make engine support cluster config event 2017-07-11 17:21:15 +08:00
filters Replace uses of filters.ToParam(), FromParam() with filters.ToJSON(), FromJSON() 2017-09-26 13:59:45 +02:00
image Set expected response headers for Ping. 2017-01-03 11:47:47 -05:00
mount Dropped hyphen in bind mount where appropriate 2017-08-19 21:25:07 +07:00
network Adding network specific options to service create/update 2017-05-17 18:46:34 -07:00
plugins/logdriver Implement plugins for logging drivers 2017-04-10 13:17:20 -04:00
registry Merge pull request #33237 from aaronlehmann/oci-types 2017-05-17 02:40:11 +02:00
strslice
swarm Add API documentation for plugable secret backends 2017-07-28 00:00:53 +02:00
time Add gosimple linter 2017-09-12 12:09:59 -04:00
versions Merge pull request #28651 from YuPengZTE/devMD002 2016-11-22 13:11:37 +01:00
volume hack/swagger-gen.sh is not exist, it should be /hack/generate-swagger-api.sh 2016-11-22 16:32:32 +08:00
auth.go
client.go LCOW: API change JSON header to string POST parameter 2017-10-06 15:26:48 -07:00
configs.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
error_response.go Update to inline comments. 2016-10-31 11:13:41 -04:00
graph_driver_data.go Generate GraphDriver from spec, and fix up image spec. 2017-01-03 11:47:47 -05:00
id_response.go Add an IDResponse type 2016-10-31 11:16:02 -04:00
image_delete_response_item.go Generate ImageDeleteResponse from swagger spec. 2017-01-03 11:47:47 -05:00
image_summary.go Generate api/types:Image from the swagger spec 2016-10-20 13:24:23 -07:00
plugin.go Update API plugin response examples 2017-07-27 18:43:13 +02:00
plugin_device.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_env.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_interface_type.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_mount.go Generate plugin types from the swagger spec. 2016-10-20 13:24:23 -07:00
plugin_responses.go Remove unused constants in plugin_responses 2017-07-25 17:07:04 +02:00
port.go Generate api/types:Port from swagger spec. 2016-10-20 13:24:23 -07:00
seccomp.go change minor mistake of spelling 2016-12-20 21:05:19 +08:00
service_update_response.go Return warnings from service create and service update when digest pinning fails 2016-11-18 09:31:31 -08:00
stats.go Correct CPU usage calculation in presence of offline CPUs and newer Linux 2017-03-10 10:24:33 +00:00
types.go Fix downlevel regression 2017-10-09 13:47:28 -07:00
volume.go Merge pull request #34186 from thaJeztah/api-update-example-data 2017-07-20 09:38:28 +02:00