podman machine: use gvproxy for host.containers.internal

Let the gvproxy dns server handle the host.containers.internal entry.
Support for this is already added to gvproxy. [1]

To make sure the container uses the dns response from gvproxy we should
not add host.containers.internal to /etc/hosts in this case.

[NO TESTS NEEDED] podman machine has no tests :/

Fixes #11642

[1] 1108ea4516

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2021-09-20 11:26:40 +02:00
parent ddb3844511
commit cf28dab9f1

View File

@ -2050,7 +2050,10 @@ func (c *Container) getHosts() string {
}
}
// Add gateway entry
// Add gateway entry if we are not in a machine. If we use podman machine
// the gvproxy dns server will take care of host.containers.internal.
// https://github.com/containers/gvisor-tap-vsock/commit/1108ea45162281046d239047a6db9bc187e64b08
if !c.runtime.config.Engine.MachineEnabled {
var depCtr *Container
netStatus := c.getNetworkStatus()
if c.config.NetNsCtr != "" {
@ -2080,6 +2083,7 @@ func (c *Container) getHosts() string {
} else {
logrus.Debug("network configuration does not support host.containers.internal address")
}
}
return hosts
}