diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-26 21:25:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 21:25:41 +0100 |
commit | 4dbb58d63759ab1019b55bc50816e30361715d8b (patch) | |
tree | be80cc0a82aa12d65a3f99f8fcde9200782b3590 /libpod | |
parent | dc2f4c63ef28d511106a926f16ed2b691aeac338 (diff) | |
parent | 7e88a579558ecc9d08bb76b5bd796b7a5e4137e2 (diff) | |
download | podman-4dbb58d63759ab1019b55bc50816e30361715d8b.tar.gz podman-4dbb58d63759ab1019b55bc50816e30361715d8b.tar.bz2 podman-4dbb58d63759ab1019b55bc50816e30361715d8b.zip |
Merge pull request #9107 from baude/v3backportdnsnameinternal
[3.0] disable dnsname when --internal
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/network/create.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libpod/network/create.go b/libpod/network/create.go index 094fbe349..6e85f2e13 100644 --- a/libpod/network/create.go +++ b/libpod/network/create.go @@ -14,6 +14,7 @@ import ( "github.com/containers/podman/v2/pkg/rootless" "github.com/containers/podman/v2/pkg/util" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // Create the CNI network @@ -226,8 +227,12 @@ func createBridge(name string, options entities.NetworkCreateOptions, runtimeCon // 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)) + if options.Internal { + logrus.Warnf("dnsname and --internal networks are incompatible. dnsname plugin not configured for network %s", name) + } else { + // Note: in the future we might like to allow for dynamic domain names + plugins = append(plugins, NewDNSNamePlugin(DefaultPodmanDomainName)) + } } ncList["plugins"] = plugins b, err := json.MarshalIndent(ncList, "", " ") |