Skip to content

Commit

Permalink
Fixing a stale endpoint issue that blocks ingress network cleanup
Browse files Browse the repository at this point in the history
fixes #24400

Signed-off-by: Madhu Venugopal <madhu@docker.com>
  • Loading branch information
mavenugo committed Jul 12, 2016
1 parent 92c40f9 commit a4926a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions daemon/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ func (daemon *Daemon) SetupIngress(create clustertypes.NetworkCreateRequest, nod
return
}

// Cleanup any stale endpoints that might be left over during previous iterations
epList := n.Endpoints()
for _, ep := range epList {
if err := ep.Delete(true); err != nil {
logrus.Errorf("Failed to delete endpoint %s (%s): %v", ep.Name(), ep.ID(), err)
}
}

if err := n.Delete(); err != nil {
logrus.Errorf("Failed to delete stale ingress network %s: %v", n.ID(), err)
return
Expand Down

0 comments on commit a4926a4

Please sign in to comment.