1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Reset endpoint port info on connectivity revoke in bridge driver

- and update it to store. Otherwise after an ungraceful shutdown,
  at next boot there will be in store two bridge endpoints with
  same port-mapping data. When bridge driver will try to restore
  the endpoints, there will be conflicts and a container with
  restart policy could fail to start.

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-05-25 11:41:36 -07:00
parent eb02cb999b
commit cff2573d1f

View file

@ -1318,6 +1318,12 @@ func (d *driver) RevokeExternalConnectivity(nid, eid string) error {
logrus.Warn(err)
}
endpoint.portMapping = nil
if err = d.storeUpdate(endpoint); err != nil {
return fmt.Errorf("failed to update bridge endpoint %s to store: %v", endpoint.id[0:7], err)
}
return nil
}