libnet: rebuildDNS: update the hash file

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
This commit is contained in:
Albin Kerouanton
2025-11-25 11:32:48 +01:00
parent 937246a868
commit eb18b398d4

View File

@@ -329,15 +329,7 @@ func (sb *Sandbox) rebuildDNS() error {
// upstream nameservers.
sb.setExternalResolvers(extNameServers)
// 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)
return rc.WriteFile(sb.config.resolvConfPath, sb.config.resolvConfHashFile, filePerm)
}
func createBasePath(dir string) error {