From 83f00e9f2b7a92026e6d6f47a3cce760a31b808d Mon Sep 17 00:00:00 2001 From: Albin Kerouanton Date: Fri, 28 Nov 2025 09:47:04 +0100 Subject: [PATCH] Revert "libnet: rebuildDNS: update the hash file" This reverts commit eb18b398d4ad0ae20be58ee3e0cae6988ac9f465. Signed-off-by: Albin Kerouanton --- daemon/libnetwork/sandbox_dns_unix.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/daemon/libnetwork/sandbox_dns_unix.go b/daemon/libnetwork/sandbox_dns_unix.go index ca18a75919..a5aac066e9 100644 --- a/daemon/libnetwork/sandbox_dns_unix.go +++ b/daemon/libnetwork/sandbox_dns_unix.go @@ -329,7 +329,15 @@ func (sb *Sandbox) rebuildDNS() error { // upstream nameservers. sb.setExternalResolvers(extNameServers) - return rc.WriteFile(sb.config.resolvConfPath, sb.config.resolvConfHashFile, filePerm) + // Write the file for the container - preserving old behaviour, not updating the + // hash file (so, no further updates will be made). + // TODO(robmry) - I think that's probably accidental, I can't find a reason for it, + // and the old resolvconf.Build() function wrote the file but not the hash, which + // is surprising. But, before fixing it, a guard/flag needs to be added to + // sb.updateDNS() to make sure that when an endpoint joins a sandbox that already + // has an internal resolver, the container's resolv.conf is still (re)configured + // for an internal resolver. + return rc.WriteFile(sb.config.resolvConfPath, "", filePerm) } func createBasePath(dir string) error {