Skip to content

Commit

Permalink
backports for v4.0.0
Browse files Browse the repository at this point in the history
add support in 4.0 for healthcheck on failure actions

Signed-off-by: Charlie Doern <[email protected]>
  • Loading branch information
cdoern committed Oct 6, 2022
1 parent ff0a8a9 commit aaedfb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 128 deletions.
128 changes: 0 additions & 128 deletions .cirrus.yml

This file was deleted.

2 changes: 2 additions & 0 deletions podman/domain/containers_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def create(
process will run as.
healthcheck (Dict[str,Any]): Specify a test to perform to check that the
container is healthy.
health_check_on_failure_action (int): Specify an action if a healthcheck fails.
hostname (str): Optional hostname for the container.
init (bool): Run an init inside the container that forwards signals and reaps processes
init_path (str): Path to the docker-init binary
Expand Down Expand Up @@ -340,6 +341,7 @@ def to_bytes(size: Union[int, str, None]) -> Union[int, None]:
"expose": {},
"groups": pop("group_add"),
"healthconfig": pop("healthcheck"),
"health_check_on_failure_action": pop("health_check_on_failure_action"),
"hostadd": [],
"hostname": pop("hostname"),
"httpproxy": pop("use_config_proxy"),
Expand Down
8 changes: 8 additions & 0 deletions podman/tests/integration/test_container_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def _test_memory_limit(self, parameter_name, host_config_name):
test['expected_value'],
)

def test_container_healtchecks(self):
"""Test passing various healthcheck options"""
parameters = {}
parameters['healthcheck'] = {'Test': ['CMD-SHELL curl http://localhost || exit']}
parameters['health_check_on_failure_action'] = 1
container = self.client.containers.create(self.alpine_image, **parameters)
self.containers.append(container)

def test_container_mem_limit(self):
"""Test passing memory limit"""
self._test_memory_limit('mem_limit', 'Memory')
Expand Down

0 comments on commit aaedfb8

Please sign in to comment.