From 13a70914f379ca7f665efe8ec69eab9b452a71d0 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 25 Oct 2022 16:14:19 +0200 Subject: [PATCH] libnetwork/netavark: disable dns for macvlan This is not supported in netavark so we should set to false by default to make sure podman inspect will show the correct info. Signed-off-by: Paul Holzinger --- common/libnetwork/netavark/config.go | 5 +++++ common/libnetwork/types/network.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/libnetwork/netavark/config.go b/common/libnetwork/netavark/config.go index 6471436525..e4cd159154 100644 --- a/common/libnetwork/netavark/config.go +++ b/common/libnetwork/netavark/config.go @@ -170,6 +170,11 @@ func createMacvlan(network *types.Network) error { } } + // always turn dns off with macvlan, it is not implemented in netavark + // and makes little sense to support with macvlan + // see https://github.com/containers/netavark/pull/467 + network.DNSEnabled = false + // we already validated the drivers before so we just have to set the default here switch network.IPAMOptions[types.Driver] { case "": diff --git a/common/libnetwork/types/network.go b/common/libnetwork/types/network.go index 307b715464..e69d6e6e19 100644 --- a/common/libnetwork/types/network.go +++ b/common/libnetwork/types/network.go @@ -54,7 +54,7 @@ type Network struct { // to public or other Networks. Internal bool `json:"internal"` // DNSEnabled is whether name resolution is active for container on - // this Network. + // this Network. Only supported with the bridge driver. DNSEnabled bool `json:"dns_enabled"` // Labels is a set of key-value labels that have been applied to the // Network.