1
0
Fork 0
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:
Daniel Zhang 2016-05-05 13:17:24 +08:00
parent 3ec7568121
commit abb3b9b12d

View file

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