Allow network-scoped alias to be resolved for annonymous endpoint

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2016-01-13 12:03:12 -08:00
parent 86bb4aa112
commit f9e4b40e5e
1 changed files with 6 additions and 6 deletions

View File

@ -822,20 +822,20 @@ func (n *network) EndpointByID(id string) (Endpoint, error) {
}
func (n *network) updateSvcRecord(ep *endpoint, localEps []*endpoint, isAdd bool) {
if ep.isAnonymous() {
return
}
epName := ep.Name()
if iface := ep.Iface(); iface.Address() != nil {
myAliases := ep.MyAliases()
if isAdd {
n.addSvcRecords(epName, iface.Address().IP, true)
if !ep.isAnonymous() {
n.addSvcRecords(epName, iface.Address().IP, true)
}
for _, alias := range myAliases {
n.addSvcRecords(alias, iface.Address().IP, false)
}
} else {
n.deleteSvcRecords(epName, iface.Address().IP, true)
if !ep.isAnonymous() {
n.deleteSvcRecords(epName, iface.Address().IP, true)
}
for _, alias := range myAliases {
n.deleteSvcRecords(alias, iface.Address().IP, false)
}