@@ -1016,10 +1016,9 @@ async def container_to_args(compose, cnt, detached=True):
1016
1016
# If it's a string, it's equivalent to specifying CMD-SHELL
1017
1017
if is_str (healthcheck_test ):
1018
1018
# podman does not add shell to handle command with whitespace
1019
- podman_args .extend ([
1020
- "--healthcheck-command" ,
1021
- "/bin/sh -c " + cmd_quote (healthcheck_test ),
1022
- ])
1019
+ podman_args .extend (
1020
+ ["--health-cmd" , "/bin/sh -c " + cmd_quote (healthcheck_test )]
1021
+ )
1023
1022
elif is_list (healthcheck_test ):
1024
1023
healthcheck_test = healthcheck_test .copy ()
1025
1024
# If it's a list, first item is either NONE, CMD or CMD-SHELL.
@@ -1028,12 +1027,12 @@ async def container_to_args(compose, cnt, detached=True):
1028
1027
podman_args .append ("--no-healthcheck" )
1029
1028
elif healthcheck_type == "CMD" :
1030
1029
cmd_q = "' '" .join ([cmd_quote (i ) for i in healthcheck_test ])
1031
- podman_args .extend (["--healthcheck-command " , "/bin/sh -c " + cmd_q ])
1030
+ podman_args .extend (["--health-cmd " , "/bin/sh -c " + cmd_q ])
1032
1031
elif healthcheck_type == "CMD-SHELL" :
1033
1032
if len (healthcheck_test ) != 1 :
1034
1033
raise ValueError ("'CMD_SHELL' takes a single string after it" )
1035
1034
cmd_q = cmd_quote (healthcheck_test [0 ])
1036
- podman_args .extend (["--healthcheck-command " , "/bin/sh -c " + cmd_q ])
1035
+ podman_args .extend (["--health-cmd " , "/bin/sh -c " + cmd_q ])
1037
1036
else :
1038
1037
raise ValueError (
1039
1038
f"unknown healthcheck test type [{ healthcheck_type } ],\
@@ -1044,15 +1043,15 @@ async def container_to_args(compose, cnt, detached=True):
1044
1043
1045
1044
# interval, timeout and start_period are specified as durations.
1046
1045
if "interval" in healthcheck :
1047
- podman_args .extend (["--healthcheck -interval" , healthcheck ["interval" ]])
1046
+ podman_args .extend (["--health -interval" , healthcheck ["interval" ]])
1048
1047
if "timeout" in healthcheck :
1049
- podman_args .extend (["--healthcheck -timeout" , healthcheck ["timeout" ]])
1048
+ podman_args .extend (["--health -timeout" , healthcheck ["timeout" ]])
1050
1049
if "start_period" in healthcheck :
1051
- podman_args .extend (["--healthcheck -start-period" , healthcheck ["start_period" ]])
1050
+ podman_args .extend (["--health -start-period" , healthcheck ["start_period" ]])
1052
1051
1053
1052
# convert other parameters to string
1054
1053
if "retries" in healthcheck :
1055
- podman_args .extend (["--healthcheck -retries" , str (healthcheck ["retries" ])])
1054
+ podman_args .extend (["--health -retries" , str (healthcheck ["retries" ])])
1056
1055
1057
1056
# handle podman extension
1058
1057
x_podman = cnt .get ("x-podman" , None )
0 commit comments