summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-01-24 16:52:37 +0100
committerPaul Holzinger <pholzing@redhat.com>2022-01-24 16:56:11 +0100
commit2f371cb12c0a637ac4fc5e58e7bb63d4deefbd03 (patch)
tree7c7edd6f1d526fcd55b4f9ceb0c0e694e8cb2ab9 /libpod
parentc96aa23adb9f1cb7e195d3585a2c78af7aab2ce5 (diff)
downloadpodman-2f371cb12c0a637ac4fc5e58e7bb63d4deefbd03.tar.gz
podman-2f371cb12c0a637ac4fc5e58e7bb63d4deefbd03.tar.bz2
podman-2f371cb12c0a637ac4fc5e58e7bb63d4deefbd03.zip
container create: do not check for network dns support
We should not check if the network supports dns when we create a container with network aliases. This could be the case for containers created by docker-compose for example if the dnsname plugin is not installed or the user uses a macvlan config where we do not support dns. Fixes #12972 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_linux.go7
-rw-r--r--libpod/runtime_ctr.go9
2 files changed, 0 insertions, 16 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 110f37b91..f3707a77d 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -1198,13 +1198,6 @@ func (c *Container) NetworkConnect(nameOrID, netName string, netOpts types.PerNe
// get network status before we connect
networkStatus := c.getNetworkStatus()
- network, err := c.runtime.network.NetworkInspect(netName)
- if err != nil {
- return err
- }
- if !network.DNSEnabled && len(netOpts.Aliases) > 0 {
- return errors.Wrapf(define.ErrInvalidArg, "cannot set network aliases for network %q because dns is disabled", netName)
- }
// always add the short id as alias for docker compat
netOpts.Aliases = append(netOpts.Aliases, c.config.ID[:12])
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 6ee25c0ec..9ab12732f 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -254,15 +254,6 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai
if err != nil {
return nil, err
}
- if len(opts.Aliases) > 0 {
- network, err := r.network.NetworkInspect(netName)
- if err != nil {
- return nil, err
- }
- if !network.DNSEnabled {
- return nil, errors.Wrapf(define.ErrInvalidArg, "cannot set network aliases for network %q because dns is disabled", netName)
- }
- }
// assign interface name if empty
if opts.InterfaceName == "" {
for i < 100000 {