Remove timeout when waiting for container to finish. (#527)

This commit is contained in:
Felix Fontein 2022-12-08 22:15:42 +01:00 committed by GitHub
parent b318c02148
commit 3a40112a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- "docker_container - when ``detach=false``, wait indefinitely and not at most one minute. This was the behavior with Docker SDK for Python, and was accidentally changed in 3.0.0 (https://github.com/ansible-collections/community.docker/issues/526, https://github.com/ansible-collections/community.docker/pull/527)."

View File

@ -281,7 +281,7 @@ class EngineDriver(object):
pass
@abc.abstractmethod
def wait_for_container(self, client, container_id):
def wait_for_container(self, client, container_id, timeout=None):
pass
@abc.abstractmethod

View File

@ -269,8 +269,8 @@ class DockerAPIEngineDriver(EngineDriver):
def start_container(self, client, container_id):
client.post_json('/containers/{0}/start', container_id)
def wait_for_container(self, client, container_id):
return client.post_json_to_json('/containers/{0}/wait', container_id)['StatusCode']
def wait_for_container(self, client, container_id, timeout=None):
return client.post_json_to_json('/containers/{0}/wait', container_id, timeout=timeout)['StatusCode']
def get_container_output(self, client, container_id):
config = client.get_json('/containers/{0}/json', container_id)