FIXES #353: down in reverse order

This commit is contained in:
Muayyad alsadi 2021-11-11 11:32:24 +02:00
parent c753b8e2cf
commit a2fef56b07

View File

@ -1450,10 +1450,11 @@ def compose_down(compose, args):
if timeout is None:
timeout = 1
podman_args.extend(['-t', "{}".format(timeout)])
containers = list(reversed(compose.containers))
for cnt in compose.containers:
for cnt in containers:
compose.podman.run([], "stop", [*podman_args, cnt["name"]], sleep=0)
for cnt in compose.containers:
for cnt in containers:
compose.podman.run([], "rm", [cnt["name"]], sleep=0)
for pod in compose.pods:
compose.podman.run([], "pod", ["rm", pod["name"]], sleep=0)