Skip to content

Commit 04fcc26

Browse files
authoredMar 5, 2025··
Merge pull request #1117 from rjeffman/no_exception_if_service_is_not_in_compose
Don't raise exception on inexistent services in 'down' command
2 parents 7c61f24 + d476071 commit 04fcc26

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed KeyError in case podman-compose down was called with an inexistent service

‎podman_compose.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,8 @@ def get_excluded(compose, args):
26482648
if args.services:
26492649
excluded = set(compose.services)
26502650
for service in args.services:
2651-
if not args.no_deps:
2651+
# we need 'getattr' as compose_down_parse dose not configure 'no_deps'
2652+
if service in compose.services and not getattr(args, "no_deps", False):
26522653
excluded -= set(x.name for x in compose.services[service]["_deps"])
26532654
excluded.discard(service)
26542655
log.debug("** excluding: %s", excluded)

0 commit comments

Comments
 (0)
Please sign in to comment.