mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Fix up handling of user defined network namespaces
If user specifies network namespace and the /etc/netns/XXX/resolv.conf exists, we should use this rather then /etc/resolv.conf Also fail cleaner if the user specifies an invalid Network Namespace. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -904,10 +904,10 @@ func WithNetNS(portMappings []ocicni.PortMapping, postConfigureNetNS bool, netmo
|
||||
}
|
||||
|
||||
ctr.config.PostConfigureNetNS = postConfigureNetNS
|
||||
ctr.config.CreateNetNS = true
|
||||
ctr.config.NetMode = namespaces.NetworkMode(netmode)
|
||||
ctr.config.CreateNetNS = !ctr.config.NetMode.IsUserDefined()
|
||||
ctr.config.PortMappings = portMappings
|
||||
ctr.config.Networks = networks
|
||||
ctr.config.NetMode = namespaces.NetworkMode(netmode)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user