Skip to content

Commit

Permalink
podman-4.1.1 renames Healthcheck to Health
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Jeanneret <cjeanner@redhat.com>
  • Loading branch information
cjeanner committed Jun 28, 2022
1 parent 2577f5b commit 5cea670
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
16 changes: 10 additions & 6 deletions plugins/module_utils/podman/podman_container_lib.py
Expand Up @@ -59,11 +59,11 @@
generate_systemd=dict(type='dict', default={}),
gidmap=dict(type='list', elements='str'),
group_add=dict(type='list', elements='str', aliases=['groups']),
healthcheck=dict(type='str'),
healthcheck_interval=dict(type='str'),
healthcheck_retries=dict(type='int'),
healthcheck_start_period=dict(type='str'),
healthcheck_timeout=dict(type='str'),
healthcheck=dict(type='str', aliases=['health_cmd']),
healthcheck_interval=dict(type='str', aliases=['health_interval']),
healthcheck_retries=dict(type='int', aliases=['health_retries']),
healthcheck_start_period=dict(type='str', aliases=['health_start_period']),
healthcheck_timeout=dict(type='str', aliases=['health_timeout']),
hostname=dict(type='str'),
http_proxy=dict(type='bool'),
image_volume=dict(type='str', choices=['bind', 'tmpfs', 'ignore']),
Expand Down Expand Up @@ -907,9 +907,13 @@ def diffparam_healthcheck(self):
# the "test" key is a list of 2 items where the first one is
# "CMD-SHELL" and the second one is the actual healthcheck command.
before = self.info['config']['healthcheck']['test'][1]
elif 'health' in self.info['config']:
before = self.info['config']['health']['test'][1]
else:
before = ''
after = self.params['healthcheck'] or before
after = self.params.get('health',
self.params.get('healthcheck',
None)) or before
return self._diff_update_and_compare('healthcheck', before, after)

# Because of hostname is random generated, this parameter has partial idempotency only.
Expand Down
10 changes: 10 additions & 0 deletions plugins/modules/podman_container.py
Expand Up @@ -374,29 +374,39 @@
description:
- Set or alter a healthcheck command for a container.
type: str
aliases:
- health
healthcheck_interval:
description:
- Set an interval for the healthchecks
(a value of disable results in no automatic timer setup)
(default "30s")
type: str
aliases:
- health_interval
healthcheck_retries:
description:
- The number of retries allowed before a healthcheck is considered to be
unhealthy. The default value is 3.
type: int
aliases:
- health_retries
healthcheck_start_period:
description:
- The initialization time needed for a container to bootstrap.
The value can be expressed in time format like 2m3s. The default value
is 0s
type: str
aliases:
- health_start_period
healthcheck_timeout:
description:
- The maximum time allowed to complete the healthcheck before an interval
is considered failed. Like start-period, the value can be expressed in
a time format such as 1m22s. The default value is 30s
type: str
aliases:
- health_timeout
hostname:
description:
- Container host name. Sets the container host name that is available
Expand Down

0 comments on commit 5cea670

Please sign in to comment.