libnetwork: Controller.cleanupLocalEndpoints: return errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2e60051c92
commit
a8ea752a93
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue