Add network "dns" support

This patch add 'x-podman.dns' option to the 'network' configuration,
allowing users to set the DNS resolvers for a defined network.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
Rafael Guterres Jeffman
2025-01-17 13:49:48 -03:00
parent 6e642dca1f
commit 9be3ec985f
4 changed files with 68 additions and 0 deletions

View File

@ -835,6 +835,11 @@ def get_network_create_args(net_desc, proj_name, net_name):
args.append("--ipv6")
if net_desc.get("x-podman.disable_dns"):
args.append("--disable-dns")
if net_desc.get("x-podman.dns"):
args.extend((
"--dns",
",".join(norm_as_list(net_desc.get("x-podman.dns"))),
))
if isinstance(ipam_config_ls, dict):
ipam_config_ls = [ipam_config_ls]