1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1494 from aboch/sipt

Do not update hosts file with internal networks endpoint IP
This commit is contained in:
Jana Radhakrishnan 2016-10-26 13:00:22 -07:00 committed by GitHub
commit fd70adfac5

View file

@ -469,6 +469,7 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) error {
n.getController().watchSvcRecord(ep)
}
if doUpdateHostsFile(n, sb) {
address := ""
if ip := ep.getFirstInterfaceAddress(); ip != nil {
address = ip.String()
@ -476,6 +477,7 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) error {
if err = sb.updateHostsFile(address); err != nil {
return err
}
}
if err = sb.updateDNS(n.enableIPv6); err != nil {
return err
}
@ -556,6 +558,10 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) error {
return nil
}
func doUpdateHostsFile(n *network, sb *sandbox) bool {
return !n.ingress && n.Name() != libnGWNetwork
}
func (ep *endpoint) rename(name string) error {
var err error
n := ep.getNetwork()