summaryrefslogtreecommitdiff
path: root/libpod/network/create.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2021-01-21 12:04:59 -0600
committerbaude <bbaude@redhat.com>2021-01-25 08:51:15 -0600
commit393a8f02612518e9715669d1cf2d7ceb101f5079 (patch)
treec862d7eb137315cd3efe3f961d8705d8f816d0da /libpod/network/create.go
parent6cef7c78dd5f8e2e8e1fe91bd2c7d1298f7e4df9 (diff)
downloadpodman-393a8f02612518e9715669d1cf2d7ceb101f5079.tar.gz
podman-393a8f02612518e9715669d1cf2d7ceb101f5079.tar.bz2
podman-393a8f02612518e9715669d1cf2d7ceb101f5079.zip
disable dnsname when --internal
when doing a network creation, the dnsname plugin should be disabled when the --internal bool is set. a warning is displayed if this happens and docs are updated. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/network/create.go')
-rw-r--r--libpod/network/create.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/libpod/network/create.go b/libpod/network/create.go
index e7f65358b..a8f985af9 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, "", " ")