mirror of
https://github.com/containers/podman-compose.git
synced 2025-01-22 05:49:04 +01:00
FIXES #76: a service extends a service with same name
This commit is contained in:
parent
0fc864ffbe
commit
12036aa54e
@ -584,6 +584,9 @@ def rec_deps(services, service_name, start_point=None):
|
|||||||
start_point = service_name
|
start_point = service_name
|
||||||
deps = services[service_name]["_deps"]
|
deps = services[service_name]["_deps"]
|
||||||
for dep_name in deps.copy():
|
for dep_name in deps.copy():
|
||||||
|
# avoid A depens on A
|
||||||
|
if dep_name==service_name:
|
||||||
|
continue
|
||||||
dep_srv = services.get(dep_name)
|
dep_srv = services.get(dep_name)
|
||||||
if not dep_srv:
|
if not dep_srv:
|
||||||
continue
|
continue
|
||||||
@ -604,7 +607,7 @@ def flat_deps(services, with_extends=False):
|
|||||||
if with_extends:
|
if with_extends:
|
||||||
ext = srv.get("extends", {}).get("service", None)
|
ext = srv.get("extends", {}).get("service", None)
|
||||||
if ext:
|
if ext:
|
||||||
deps.add(ext)
|
if ext != name: deps.add(ext)
|
||||||
continue
|
continue
|
||||||
deps.update(srv.get("depends_on", []))
|
deps.update(srv.get("depends_on", []))
|
||||||
# parse link to get service name and remove alias
|
# parse link to get service name and remove alias
|
||||||
|
Loading…
Reference in New Issue
Block a user