mirror of
https://github.com/containers/podman.git
synced 2025-08-03 01:37:51 +08:00
fix slirp4netns resolv.conf ip with a userns
When a userns is set we setup the network after the bind mounts, at the point where resolv.conf is generated we do not yet know the subnet. Just like the other dns servers for bridge networks we need to add the ip later in completeNetworkSetup() Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2182052 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -1003,6 +1003,8 @@ func (c *Container) completeNetworkSetup() error {
|
||||
nameservers = append(nameservers, server.String())
|
||||
}
|
||||
}
|
||||
nameservers = c.addSlirp4netnsDNS(nameservers)
|
||||
|
||||
// check if we have a bindmount for /etc/hosts
|
||||
if hostsBindMount, ok := state.BindMounts[config.DefaultHostsFile]; ok {
|
||||
entries, err := c.getHostsEntries()
|
||||
|
Reference in New Issue
Block a user