Add healthcheck.disable support

Signed-off-by: inganault <p.po.oo.on.n@gmail.com>
This commit is contained in:
inganault 2022-07-14 20:24:43 +07:00 committed by Muayyad Alsadi
parent ae6be272b5
commit 859f03cbe6

View File

@ -931,11 +931,15 @@ def container_to_args(compose, cnt, detached=True):
platform = cnt.get("platform", None)
if platform is not None:
podman_args.extend(["--platform", platform])
# WIP: healthchecks are still work in progress
healthcheck = cnt.get("healthcheck", None) or {}
if not is_dict(healthcheck):
raise ValueError("'healthcheck' must be an key-value mapping")
healthcheck_disable = healthcheck.get("disable", False)
healthcheck_test = healthcheck.get("test", None)
if healthcheck_disable:
healthcheck_test = ["NONE"]
if healthcheck_test:
# If it's a string, it's equivalent to specifying CMD-SHELL
if is_str(healthcheck_test):