beb97f7fdf
Replace regex matching/replacement and re-reading of generated files with a simple parser, and struct to remember and manipulate the file content. Annotate the generated file with a header comment saying the file is generated, but can be modified, and a trailing comment describing how the file was generated and listing external nameservers. Always start with the host's resolv.conf file, whether generating config for host networking, or with/without an internal resolver - rather than editing a file previously generated for a different use-case. Resolves an issue where rewrites of the generated file resulted in default IPv6 nameservers being unnecessarily added to the config. Signed-off-by: Rob Murray <rob.murray@docker.com>
27 lines
516 B
Go
27 lines
516 B
Go
//go:build windows
|
|
|
|
package libnetwork
|
|
|
|
import (
|
|
"github.com/docker/docker/libnetwork/etchosts"
|
|
)
|
|
|
|
// Stub implementations for DNS related functions
|
|
|
|
func (sb *Sandbox) setupResolutionFiles() error {
|
|
return nil
|
|
}
|
|
|
|
func (sb *Sandbox) restoreHostsPath() {}
|
|
|
|
func (sb *Sandbox) restoreResolvConfPath() {}
|
|
|
|
func (sb *Sandbox) updateHostsFile(ifaceIP []string) error {
|
|
return nil
|
|
}
|
|
|
|
func (sb *Sandbox) deleteHostsEntries(recs []etchosts.Record) {}
|
|
|
|
func (sb *Sandbox) updateDNS(ipv6Enabled bool) error {
|
|
return nil
|
|
}
|