Skip to content

check if container already created #1251

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

doc-sheet
Copy link

PoC for #1118


if args.force_recreate or cnt["name"] not in created_containers:
podman_args = await container_to_args(
compose, cnt, detached=False, no_deps=args.no_deps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also check for running containers and not start these?

Copy link
Author

@doc-sheet doc-sheet Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked - podman start for already started container just exits with rc 0 so I skipped extra validation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think it makes sense to add an explanatory comment near the call to podman start then.

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, thanks! Several integration tests will be needed:

  • some containers created, not running
  • some containers created and running
  • all containers created, not running
  • all containers created, some running
  • all containers created and running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants