mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fixes #22466 Embedded DNS problem after renaming container
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
This commit is contained in:
parent
3ec7568121
commit
abb3b9b12d
1 changed files with 3 additions and 0 deletions
|
@ -533,13 +533,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