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

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

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)
}