mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
If anonymous container has alias names use it for DNS PTR record
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
parent
bb3c060954
commit
dd48b1c688
1 changed files with 13 additions and 2 deletions
|
@ -851,14 +851,25 @@ func (n *network) updateSvcRecord(ep *endpoint, localEps []*endpoint, isAdd bool
|
||||||
if iface := ep.Iface(); iface.Address() != nil {
|
if iface := ep.Iface(); iface.Address() != nil {
|
||||||
myAliases := ep.MyAliases()
|
myAliases := ep.MyAliases()
|
||||||
if isAdd {
|
if isAdd {
|
||||||
if !ep.isAnonymous() {
|
// If anonymous endpoint has an alias use the first alias
|
||||||
|
// for ip->name mapping. Not having the reverse mapping
|
||||||
|
// breaks some apps
|
||||||
|
if ep.isAnonymous() {
|
||||||
|
if len(myAliases) > 0 {
|
||||||
|
n.addSvcRecords(myAliases[0], iface.Address().IP, true)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
n.addSvcRecords(epName, iface.Address().IP, true)
|
n.addSvcRecords(epName, iface.Address().IP, true)
|
||||||
}
|
}
|
||||||
for _, alias := range myAliases {
|
for _, alias := range myAliases {
|
||||||
n.addSvcRecords(alias, iface.Address().IP, false)
|
n.addSvcRecords(alias, iface.Address().IP, false)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !ep.isAnonymous() {
|
if ep.isAnonymous() {
|
||||||
|
if len(myAliases) > 0 {
|
||||||
|
n.deleteSvcRecords(myAliases[0], iface.Address().IP, true)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
n.deleteSvcRecords(epName, iface.Address().IP, true)
|
n.deleteSvcRecords(epName, iface.Address().IP, true)
|
||||||
}
|
}
|
||||||
for _, alias := range myAliases {
|
for _, alias := range myAliases {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue