-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Podman 3.3 adds 127.0.0.1 /etc/hosts record for hostname, breaking gethostbyaddr for the hostname #11596
Comments
OK so I think the problem here is that our logic thinks joining the pod namespace is the same as the I think we should never add Edit: This is the result I get when 127... is not added.
|
Yes, this looks like a good improvement. |
The check for net=none was wrong. It just assumed when we do not create the netns but have one set that we use the none mode. This however also applies to a container which joins the pod netns. To correctly check for the none mode use `config.NetMode.IsNone()`. Fixes containers#11596 Signed-off-by: Paul Holzinger <[email protected]>
The check for net=none was wrong. It just assumed when we do not create the netns but have one set that we use the none mode. This however also applies to a container which joins the pod netns. To correctly check for the none mode use `config.NetMode.IsNone()`. Fixes containers#11596 Signed-off-by: Paul Holzinger <[email protected]>
I see the fix should be in podman 3.4 but https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_21.04/ still has only 3.3.1. Is there any plan to build 3.4 there? |
@lsm5 PTAL |
…ution." This reverts commit 7699cbc. Issue containers/podman#11596 was fixed in podman 3.4.
With podman-3.4.4-1.fc35.x86_64 I get
I don't see a problem with the IP address being different as long as the hostname is the expected one. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
The change for #10319 via #11118 changed the
/etc/hosts
entry being added from 127.0.1.1 to 127.0.0.1. That in turn breaks gethostbyaddr in the container, at least in rootless pods.Steps to reproduce the issue:
podman pod create --name test-hostname --hostname machine.example.test --add-host machine.example.test:172.29.0.1
podman run --rm --pod test-hostname registry.fedoraproject.org/fedora:34 cat /etc/hosts
podman run --rm --pod test-hostname registry.fedoraproject.org/fedora:34 python3 -c 'import socket; print(socket.gethostbyaddr("machine.example.test"))'
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
This is a regression with podman-3.3.1-1.fc34.x86_64, against podman-3.2.3-1.fc34.x86_64.
Now the previous behaviour which returned 127.0.1.1 was not great either but at least the hostname returned was the actual container hostname, not
localhost
.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes (latest packaged in Fedora 34).
Additional environment details (AWS, VirtualBox, physical, etc.):
A Fedora 34 VM.
The text was updated successfully, but these errors were encountered: