diff --git a/newsfragments/down-during-up-no-containers.bugfix b/newsfragments/down-during-up-no-containers.bugfix new file mode 100644 index 0000000..ed4e319 --- /dev/null +++ b/newsfragments/down-during-up-no-containers.bugfix @@ -0,0 +1 @@ +Skip running compose-down during up when there are no active containers diff --git a/podman_compose.py b/podman_compose.py index 69613e3..22d55cd 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -2891,7 +2891,7 @@ async def compose_up(compose: PodmanCompose, args): .splitlines() ) diff_hashes = [i for i in hashes if i and i != compose.yaml_hash] - if args.force_recreate or len(diff_hashes): + if (args.force_recreate and len(hashes) > 0) or len(diff_hashes): log.info("recreating: ...") down_args = argparse.Namespace(**dict(args.__dict__, volumes=False, rmi=None)) await compose.commands["down"](compose, down_args)