`extraHosts` with `useDefaultSandbox` results in /etc/hosts being replaced rather than updated
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
In docker terms, using the --add-hosts flag with the --net=host flag results in the /etc/hosts having only the --add-hosts lines. The content from the machine's /etc/hosts is not present.
I believe this is in part due to changes in PR#2232 (though the behavior before might have been that --add-hosts was silently ignored, which is probably more incorrect).
In sandbox_dns_unix.go:84, we skip over the block to copy from originHostsPath if extraHosts is non-empty.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in sandbox_dns_unix.go around line 84 and trace how originHostsPath and extraHosts are handled when useDefaultSandbox is enabled. Reproduce the --add-hosts and --net=host combination, then verify that the machine's /etc/hosts content remains present alongside the added host entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100