Merge pull request #1164 from jmzwcn/issue22466-patches
Embedded DNS problem after renaming container. Step1:change in libnetwork side
This commit is contained in:
commit
e7f368350c
1 changed files with 3 additions and 0 deletions
|
@ -540,13 +540,16 @@ func (ep *endpoint) rename(name string) error {
|
|||
n.updateSvcRecord(ep, n.getController().getLocalEps(netWatch), false)
|
||||
|
||||
oldName := ep.name
|
||||
oldAnonymous := ep.anonymous
|
||||
ep.name = name
|
||||
ep.anonymous = false
|
||||
|
||||
n.updateSvcRecord(ep, n.getController().getLocalEps(netWatch), true)
|
||||
defer func() {
|
||||
if err != nil {
|
||||
n.updateSvcRecord(ep, n.getController().getLocalEps(netWatch), false)
|
||||
ep.name = oldName
|
||||
ep.anonymous = oldAnonymous
|
||||
n.updateSvcRecord(ep, n.getController().getLocalEps(netWatch), true)
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Reference in a new issue