mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-22 16:03:16 +01:00
FIXES #15: respect container_name
This commit is contained in:
parent
5f7e46dbbe
commit
882cef73b7
@ -497,11 +497,15 @@ def run_compose(
|
|||||||
replicas = try_int(service_desc.get('deploy', {}).get('replicas', '1'))
|
replicas = try_int(service_desc.get('deploy', {}).get('replicas', '1'))
|
||||||
container_names_by_service[service_name] = []
|
container_names_by_service[service_name] = []
|
||||||
for num in range(1, replicas+1):
|
for num in range(1, replicas+1):
|
||||||
name = "{project_name}_{service_name}_{num}".format(
|
name0 = "{project_name}_{service_name}_{num}".format(
|
||||||
project_name=project_name,
|
project_name=project_name,
|
||||||
service_name=service_name,
|
service_name=service_name,
|
||||||
num=num,
|
num=num,
|
||||||
)
|
)
|
||||||
|
if num == 1:
|
||||||
|
name = service_desc.get("container_name", name0)
|
||||||
|
else:
|
||||||
|
name = name0
|
||||||
container_names_by_service[service_name].append(name)
|
container_names_by_service[service_name].append(name)
|
||||||
# print(service_name,service_desc)
|
# print(service_name,service_desc)
|
||||||
cnt = dict(name=name, num=num,
|
cnt = dict(name=name, num=num,
|
||||||
|
Loading…
Reference in New Issue
Block a user