mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-30 23:16:40 +02:00
#154: no -t for start
This commit is contained in:
parent
38219eb85c
commit
bd29ddb3e9
@ -96,6 +96,7 @@ PODMAN_CMDS = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
t_re=re.compile('^(?:(\d+)[m:])?(?:(\d+(?:\.\d+)?)s?)?$')
|
t_re=re.compile('^(?:(\d+)[m:])?(?:(\d+(?:\.\d+)?)s?)?$')
|
||||||
|
STOP_GRACE_PERIOD = "10"
|
||||||
|
|
||||||
def str_to_seconds(txt):
|
def str_to_seconds(txt):
|
||||||
if not txt: return None
|
if not txt: return None
|
||||||
@ -2126,7 +2127,7 @@ def compose_down(compose, args):
|
|||||||
continue
|
continue
|
||||||
podman_stop_args = [*podman_args]
|
podman_stop_args = [*podman_args]
|
||||||
if timeout is None:
|
if timeout is None:
|
||||||
timeout_str = cnt.get("stop_grace_period", None) or "10"
|
timeout_str = cnt.get("stop_grace_period", None) or STOP_GRACE_PERIOD
|
||||||
timeout = str_to_seconds(timeout_str)
|
timeout = str_to_seconds(timeout_str)
|
||||||
if timeout is not None:
|
if timeout is not None:
|
||||||
podman_stop_args.extend(["-t", str(timeout)])
|
podman_stop_args.extend(["-t", str(timeout)])
|
||||||
@ -2290,11 +2291,12 @@ def transfer_service_status(compose, args, action):
|
|||||||
podman_args = []
|
podman_args = []
|
||||||
timeout = getattr(args, "timeout", None)
|
timeout = getattr(args, "timeout", None)
|
||||||
for target in targets:
|
for target in targets:
|
||||||
if timeout is None:
|
if action != "start":
|
||||||
timeout_str = compose.container_by_name[target].get("stop_grace_period", None) or "10"
|
if timeout is None:
|
||||||
timeout = str_to_seconds(timeout_str)
|
timeout_str = compose.container_by_name[target].get("stop_grace_period", None) or STOP_GRACE_PERIOD
|
||||||
if timeout is not None:
|
timeout = str_to_seconds(timeout_str)
|
||||||
podman_args.extend(["-t", str(timeout)])
|
if timeout is not None:
|
||||||
|
podman_args.extend(["-t", str(timeout)])
|
||||||
compose.podman.run([], action, podman_args + [target], sleep=0)
|
compose.podman.run([], action, podman_args + [target], sleep=0)
|
||||||
|
|
||||||
|
|
||||||
@ -2515,7 +2517,7 @@ def compose_up_parse(parser):
|
|||||||
"-t",
|
"-t",
|
||||||
"--timeout",
|
"--timeout",
|
||||||
type=int,
|
type=int,
|
||||||
default=10,
|
default=None,
|
||||||
help="Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)",
|
help="Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@ -2694,7 +2696,7 @@ def compose_parse_timeout(parser):
|
|||||||
"--timeout",
|
"--timeout",
|
||||||
help="Specify a shutdown timeout in seconds. ",
|
help="Specify a shutdown timeout in seconds. ",
|
||||||
type=int,
|
type=int,
|
||||||
default=10,
|
default=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user