mirror of
https://github.com/containers/podman.git
synced 2025-07-03 17:27:18 +08:00
use new c/common pasta2 setup logic to fix dns
By default we just ignored any localhost reolvers, this is problematic for anyone with more complicated dns setups, i.e. split dns with systemd-reolved. To address this we now make use of the build in dns proxy in pasta. As such we need to set the default nameserver ip now. A second change is the option to exclude certain ips when generating the host.containers.internal ip. With that we no longer set it to the same ip as is used in the netns. The fix is not perfect as it could mean on a system with a single ip we no longer add the entry, however given the previous entry was incorrect anyway this seems like the better behavior. Fixes #22044 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -11,7 +11,6 @@ import (
|
||||
|
||||
"github.com/containernetworking/plugins/pkg/ns"
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
netUtil "github.com/containers/common/libnetwork/util"
|
||||
"github.com/containers/common/pkg/netns"
|
||||
"github.com/containers/podman/v5/libpod/define"
|
||||
"github.com/containers/podman/v5/pkg/rootless"
|
||||
@ -300,13 +299,3 @@ func (c *Container) inspectJoinedNetworkNS(networkns string) (q types.StatusBloc
|
||||
})
|
||||
return result, err
|
||||
}
|
||||
|
||||
func getPastaIP(state *ContainerState) (net.IP, error) {
|
||||
var ip string
|
||||
err := ns.WithNetNSPath(state.NetNS, func(_ ns.NetNS) error {
|
||||
// get the first ip in the netns
|
||||
ip = netUtil.GetLocalIP()
|
||||
return nil
|
||||
})
|
||||
return net.ParseIP(ip), err
|
||||
}
|
||||
|
Reference in New Issue
Block a user