mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-22 07:53:16 +01:00
Fix KeyErrors encountered with extended services
Docker compose file used: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/view/lib/wikibase-tainted-ref/docker-compose.yml
This commit is contained in:
parent
29d4cdc9ab
commit
7ebbe2efc6
@ -600,6 +600,7 @@ def flat_deps(services, with_extends=False):
|
||||
"""
|
||||
for name, srv in services.items():
|
||||
deps = set()
|
||||
srv["_deps"] = deps
|
||||
if with_extends:
|
||||
ext = srv.get("extends", {}).get("service", None)
|
||||
if ext:
|
||||
@ -609,7 +610,6 @@ def flat_deps(services, with_extends=False):
|
||||
# parse link to get service name and remove alias
|
||||
deps.update([(c.split(":")[0] if ":" in c else c)
|
||||
for c in srv.get("links", [])])
|
||||
srv["_deps"] = deps
|
||||
for name, srv in services.items():
|
||||
rec_deps(services, name)
|
||||
|
||||
@ -714,7 +714,10 @@ def resolve_extends(services, service_names, dotenv_dict):
|
||||
else:
|
||||
from_service = services.get(from_service_name, {}).copy()
|
||||
del from_service["_deps"]
|
||||
del from_service["extends"]
|
||||
try:
|
||||
del from_service["extends"]
|
||||
except KeyError:
|
||||
pass
|
||||
new_service = rec_merge({}, from_service, service)
|
||||
services[name] = new_service
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user