mirror of
https://github.com/moby/moby.git
synced 2026-07-11 09:08:27 +00:00
libnetwork: Controller.cleanupLocalEndpoints: return errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -151,7 +151,9 @@ func New(cfgOptions ...config.Option) (*Controller, error) {
|
||||
if err := c.sandboxCleanup(c.cfg.ActiveSandboxes); err != nil {
|
||||
log.G(context.TODO()).WithError(err).Error("error during sandbox cleanup")
|
||||
}
|
||||
c.cleanupLocalEndpoints()
|
||||
if err := c.cleanupLocalEndpoints(); err != nil {
|
||||
log.G(context.TODO()).WithError(err).Warnf("error during endpoint cleanup")
|
||||
}
|
||||
c.networkCleanup()
|
||||
|
||||
if err := c.startExternalKeyListener(); err != nil {
|
||||
|
||||
@@ -1144,7 +1144,7 @@ func (ep *Endpoint) releaseAddress() {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) cleanupLocalEndpoints() {
|
||||
func (c *Controller) cleanupLocalEndpoints() error {
|
||||
// Get used endpoints
|
||||
eps := make(map[string]interface{})
|
||||
for _, sb := range c.sandboxes {
|
||||
@@ -1154,8 +1154,7 @@ func (c *Controller) cleanupLocalEndpoints() {
|
||||
}
|
||||
nl, err := c.getNetworks()
|
||||
if err != nil {
|
||||
log.G(context.TODO()).Warnf("Could not get list of networks during endpoint cleanup: %v", err)
|
||||
return
|
||||
return fmt.Errorf("could not get list of networks: %v", err)
|
||||
}
|
||||
|
||||
for _, n := range nl {
|
||||
@@ -1192,4 +1191,6 @@ func (c *Controller) cleanupLocalEndpoints() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user