mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove enpoint state from cluster on join failure
Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
4bca322c68
commit
dce60f5afb
1 changed files with 8 additions and 0 deletions
|
@ -519,6 +519,14 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) error {
|
|||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if e := ep.deleteDriverInfoFromCluster(); e != nil {
|
||||
logrus.Errorf("Could not delete endpoint state for endpoint %s from cluster on join failure: %v", ep.Name(), e)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
if sb.needDefaultGW() && sb.getEndpointInGWNetwork() == nil {
|
||||
return sb.setupDefaultGW()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue