Skip to content

Commit cba6a70

Browse files
Use new Podman flags for healthcheck
1 parent bce40c2 commit cba6a70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

podman_compose.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ def container_to_args(compose, cnt, detached=True):
10401040
if is_str(healthcheck_test):
10411041
# podman does not add shell to handle command with whitespace
10421042
podman_args.extend(
1043-
["--healthcheck-command", "/bin/sh -c " + cmd_quote(healthcheck_test)]
1043+
["--health-cmd", "/bin/sh -c " + cmd_quote(healthcheck_test)]
10441044
)
10451045
elif is_list(healthcheck_test):
10461046
healthcheck_test = healthcheck_test.copy()
@@ -1050,12 +1050,12 @@ def container_to_args(compose, cnt, detached=True):
10501050
podman_args.append("--no-healthcheck")
10511051
elif healthcheck_type == "CMD":
10521052
cmd_q = "' '".join([cmd_quote(i) for i in healthcheck_test])
1053-
podman_args.extend(["--healthcheck-command", "/bin/sh -c " + cmd_q])
1053+
podman_args.extend(["--health-cmd", "/bin/sh -c " + cmd_q])
10541054
elif healthcheck_type == "CMD-SHELL":
10551055
if len(healthcheck_test) != 1:
10561056
raise ValueError("'CMD_SHELL' takes a single string after it")
10571057
cmd_q = cmd_quote(healthcheck_test[0])
1058-
podman_args.extend(["--healthcheck-command", "/bin/sh -c " + cmd_q])
1058+
podman_args.extend(["--health-cmd", "/bin/sh -c " + cmd_q])
10591059
else:
10601060
raise ValueError(
10611061
f"unknown healthcheck test type [{healthcheck_type}],\
@@ -1066,15 +1066,15 @@ def container_to_args(compose, cnt, detached=True):
10661066

10671067
# interval, timeout and start_period are specified as durations.
10681068
if "interval" in healthcheck:
1069-
podman_args.extend(["--healthcheck-interval", healthcheck["interval"]])
1069+
podman_args.extend(["--health-interval", healthcheck["interval"]])
10701070
if "timeout" in healthcheck:
1071-
podman_args.extend(["--healthcheck-timeout", healthcheck["timeout"]])
1071+
podman_args.extend(["--health-timeout", healthcheck["timeout"]])
10721072
if "start_period" in healthcheck:
1073-
podman_args.extend(["--healthcheck-start-period", healthcheck["start_period"]])
1073+
podman_args.extend(["--health-start-period", healthcheck["start_period"]])
10741074

10751075
# convert other parameters to string
10761076
if "retries" in healthcheck:
1077-
podman_args.extend(["--healthcheck-retries", str(healthcheck["retries"])])
1077+
podman_args.extend(["--health-retries", str(healthcheck["retries"])])
10781078

10791079
# handle podman extension
10801080
x_podman = cnt.get("x-podman", None)

0 commit comments

Comments
 (0)