Merge pull request #1164 from jmzwcn/issue22466-patches

Embedded DNS problem after renaming container. Step1:change in libnetwork side
This commit is contained in:
Santhosh Manohar 2016-06-03 11:54:02 -07:00
commit e7f368350c

View file

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