Skip to content

Commit aaedfb8

Browse files
committed
backports for v4.0.0
add support in 4.0 for healthcheck on failure actions Signed-off-by: Charlie Doern <[email protected]>
1 parent ff0a8a9 commit aaedfb8

File tree

3 files changed

+10
-128
lines changed

3 files changed

+10
-128
lines changed

.cirrus.yml

Lines changed: 0 additions & 128 deletions
This file was deleted.

podman/domain/containers_create.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def create(
7474
process will run as.
7575
healthcheck (Dict[str,Any]): Specify a test to perform to check that the
7676
container is healthy.
77+
health_check_on_failure_action (int): Specify an action if a healthcheck fails.
7778
hostname (str): Optional hostname for the container.
7879
init (bool): Run an init inside the container that forwards signals and reaps processes
7980
init_path (str): Path to the docker-init binary
@@ -340,6 +341,7 @@ def to_bytes(size: Union[int, str, None]) -> Union[int, None]:
340341
"expose": {},
341342
"groups": pop("group_add"),
342343
"healthconfig": pop("healthcheck"),
344+
"health_check_on_failure_action": pop("health_check_on_failure_action"),
343345
"hostadd": [],
344346
"hostname": pop("hostname"),
345347
"httpproxy": pop("use_config_proxy"),

podman/tests/integration/test_container_create.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ def _test_memory_limit(self, parameter_name, host_config_name):
6767
test['expected_value'],
6868
)
6969

70+
def test_container_healtchecks(self):
71+
"""Test passing various healthcheck options"""
72+
parameters = {}
73+
parameters['healthcheck'] = {'Test': ['CMD-SHELL curl http://localhost || exit']}
74+
parameters['health_check_on_failure_action'] = 1
75+
container = self.client.containers.create(self.alpine_image, **parameters)
76+
self.containers.append(container)
77+
7078
def test_container_mem_limit(self):
7179
"""Test passing memory limit"""
7280
self._test_memory_limit('mem_limit', 'Memory')

0 commit comments

Comments
 (0)