-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Do not add an entry to /etc/hosts with --net=host
#11118
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1676a45
to
952c857
Compare
code LGTM but tests failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but there is a failing test
To match Docker's behavior, in the `--net=host` case, we need to use the host's `/etc/hosts` file, unmodified (without adding an entry for the container). We will still respect hosts from `--add-host` but will not make any automatic changes. Fortuntely, this is strictly a matter of removal and refactoring as we already base our `/etc/hosts` on the host's version - just need to remove the code that added entries when net=host was set. Fixes containers#10319 Signed-off-by: Matthew Heon <[email protected]>
952c857
to
cfcd1e1
Compare
Well, that test will never work now. Removing it. |
/lgtm |
/hold cancel |
Can someone please confirm, if this fix available in 2.2.1 release as well or merged into latest only? |
No, it is not available in v2.2.1. That release is long since out of support, and is no longer receiving backports. |
To match Docker's behavior, in the
--net=host
case, we need to use the host's/etc/hosts
file, unmodified (without adding an entry for the container). We will still respect hosts from--add-host
but will not make any automatic changes.Fortuntely, this is strictly a matter of removal and refactoring as we already base our
/etc/hosts
on the host's version - just need to remove the code that added entries when net=host was set.Fixes #10319