From 1cdc9e65523f5a4dbfd2628b7f09d9edeb489b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Hirschfeld?= Date: Sun, 23 Feb 2025 00:26:09 +0100 Subject: [PATCH] interface_name can be specified in net_config_ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Hirschfeld --- podman_compose.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/podman_compose.py b/podman_compose.py index cd78288..5a0e138 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -989,6 +989,7 @@ def get_net_args_from_networks(compose, cnt): default_net_name = default_network_name_for_project(compose, net_, is_ext) net_name = ext_desc.get("name") or net_desc.get("name") or default_net_name + interface_name = net_config_.get("x-podman.interface_name") ipv4 = net_config_.get("ipv4_address") ipv6 = net_config_.get("ipv6_address") # Note: mac_address is supported by compose spec now, and x-podman.mac_address @@ -1006,6 +1007,8 @@ def get_net_args_from_networks(compose, cnt): mac_address = None net_options = [] + if interface_name: + net_options.append(f"interface_name={interface_name}") if ipv4: net_options.append(f"ip={ipv4}") if ipv6: