Add support to set --route of podman network create

This is not present in the compose spec. However, netavark podman
network backend does support --route option, which is useful for various
kinds of things. It is very easy to expose it.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
Povilas Kanapickas
2025-07-06 19:48:17 +03:00
parent c7bce311db
commit 8113a16baf
4 changed files with 57 additions and 0 deletions

View File

@@ -898,6 +898,10 @@ def get_network_create_args(net_desc: dict[str, Any], proj_name: str, net_name:
"--dns",
",".join(norm_as_list(net_desc.get("x-podman.dns"))),
))
if net_desc.get("x-podman.routes"):
routes = norm_as_list(net_desc.get("x-podman.routes"))
for route in routes:
args.extend(["--route", route])
if isinstance(ipam_config_ls, dict):
ipam_config_ls = [ipam_config_ls]