Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod Removal with only container being infra #340

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ def compose_up(compose, args):
podman_args = container_to_args(compose, cnt, detached=args.detach)
subproc = compose.podman.run([], podman_command, podman_args)
if podman_command == 'run' and subproc.returncode:
compose.podman.run([], 'start', [cnt['name']])
compose.podman.run([], 'start', [cnt['name']]) # potentila issue using container run instead of pod start
if args.no_start or args.detach or args.dry_run:
return
# TODO: handle already existing
Expand Down Expand Up @@ -1395,7 +1395,8 @@ def compose_down(compose, args):
for cnt in compose.containers:
compose.podman.run([], "rm", [cnt["name"]], sleep=0)
for pod in compose.pods:
compose.podman.run([], "pod", ["rm", pod["name"]], sleep=0)
compose.podman.run([], "pod", ["stop", pod["name"]], sleep=0) # stop pod for the purpose of stopping infra container if still running
compose.podman.run([], "pod", ["rm", "--force", pod["name"]], sleep=0)

@cmd_run(podman_compose, 'ps', 'show status of containers')
def compose_ps(compose, args):
Expand Down