Merge pull request #45000 from corhere/backport-23.0/fix-dns-opt-host-loopback

[23.0 backport] libnetwork: check DNS loopback with user DNS opts
This commit is contained in:
Cory Snider 2023-02-14 16:16:49 -05:00 committed by GitHub
commit 111658c7f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -263,7 +263,7 @@ func (sb *sandbox) setupDNS() error {
// After building the resolv.conf from the user config save the
// external resolvers in the sandbox. Note that --dns 127.0.0.x
// config refers to the loopback in the container namespace
sb.setExternalResolvers(newRC.Content, resolvconf.IPv4, false)
sb.setExternalResolvers(newRC.Content, resolvconf.IPv4, len(sb.config.dnsList) == 0)
} else {
// If the host resolv.conf file has 127.0.0.x container should
// use the host resolver for queries. This is supported by the