From 179f9ab0e31c28c523da0c28ad51d77ff9f9111a Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Mon, 13 Dec 2021 00:24:23 +0200 Subject: [PATCH] FIXES #288: do not create external network --- podman_compose.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index 5ab44d2..d5dea31 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -577,14 +577,16 @@ def assert_cnt_nets(compose, cnt): def get_net_args(compose, cnt): service_name = cnt["service_name"] - project_name = compose.project_name + proj_name = compose.project_name default_net = compose.default_net nets = compose.networks cnt_nets = norm_as_list(cnt.get("networks", None) or default_net) net_names = set() for net in cnt_nets: net_desc = nets[net] or {} - net_name = net_desc.get("name", None) or f"{project_name}_{net}" + is_ext = net_desc.get("external", None) + default_net_name = net if is_ext else f"{proj_name}_{net}" + net_name = net_desc.get("name", None) or default_net_name net_names.add(net_name) net_names_str = ",".join(net_names) return ["--net", net_names_str, "--network-alias", service_name]