Skip to content

Commit

Permalink
Reset endpoint port info on connectivity revoke in bridge driver
Browse files Browse the repository at this point in the history
- 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.

cherry-pick from: moby/libnetwork#1504

Signed-off-by: Alessandro Boch <[email protected]>
Signed-off-by: Lei Jitang <[email protected]>
  • Loading branch information
coolljt0725 committed Jun 26, 2017
1 parent d635c83 commit 41cb90a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,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
}

Expand Down

0 comments on commit 41cb90a

Please sign in to comment.