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:
parent
86bb4aa112
commit
f9e4b40e5e
1 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue