Merge pull request #9648 from estesp/9202-update-resolvconf

Update container resolv.conf when host network changes /etc/resolv.conf
This commit is contained in:
Alexander Morozov
2015-01-08 14:06:55 -08:00
24 changed files with 3373 additions and 51 deletions
-8
View File
@@ -291,14 +291,6 @@ func NewHTTPRequestError(msg string, res *http.Response) error {
}
}
var localHostRx = regexp.MustCompile(`(?m)^nameserver 127[^\n]+\n*`)
// RemoveLocalDns looks into the /etc/resolv.conf,
// and removes any local nameserver entries.
func RemoveLocalDns(resolvConf []byte) []byte {
return localHostRx.ReplaceAll(resolvConf, []byte{})
}
// An StatusError reports an unsuccessful exit by a command.
type StatusError struct {
Status string