diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2020-10-16 12:05:52 +0200 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2020-10-17 15:25:58 +0200 |
commit | 0fd543790474378575a22de416a4f77cdcc1ce06 (patch) | |
tree | 4197cadbbf984e759c1413b3f1d1fbf5305b5e29 | |
parent | 39f1bea46dbdbefb917d361726e8452e9fa5c276 (diff) | |
download | podman-0fd543790474378575a22de416a4f77cdcc1ce06.tar.gz podman-0fd543790474378575a22de416a4f77cdcc1ce06.tar.bz2 podman-0fd543790474378575a22de416a4f77cdcc1ce06.zip |
Always add the dnsname plugin to the config for rootless
The rootless-cni-infra container always has the dnsname
plugin installed. It makes no sense to check if it is
present on the host.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
-rw-r--r-- | libpod/network/create.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/network/create.go b/libpod/network/create.go index a9ed4c4ef..bf11631bf 100644 --- a/libpod/network/create.go +++ b/libpod/network/create.go @@ -10,6 +10,7 @@ import ( "github.com/containernetworking/cni/pkg/version" "github.com/containers/podman/v2/libpod" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/rootless" "github.com/containers/podman/v2/pkg/util" "github.com/pkg/errors" ) @@ -131,8 +132,9 @@ func createBridge(r *libpod.Runtime, name string, options entities.NetworkCreate plugins = append(plugins, bridge) plugins = append(plugins, NewPortMapPlugin()) plugins = append(plugins, NewFirewallPlugin()) - // if we find the dnsname plugin, we add configuration for it - if HasDNSNamePlugin(runtimeConfig.Network.CNIPluginDirs) && !options.DisableDNS { + // if we find the dnsname plugin or are rootless, we add configuration for it + // the rootless-cni-infra container has the dnsname plugin always installed + if (HasDNSNamePlugin(runtimeConfig.Network.CNIPluginDirs) || rootless.IsRootless()) && !options.DisableDNS { // Note: in the future we might like to allow for dynamic domain names plugins = append(plugins, NewDNSNamePlugin(DefaultPodmanDomainName)) } |