mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Reserve IPAM pools before resource cleanup
If the IPAM pools are not reserved before resource cleanup happens then the resource release will not happen correctly. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
parent
bd39ba82a4
commit
a70909792a
1 changed files with 8 additions and 2 deletions
|
@ -203,12 +203,18 @@ func New(cfgOptions ...config.Option) (NetworkController, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reserve pools first before doing cleanup. This is because
|
||||||
|
// if the pools are not populated properly, the cleanups of
|
||||||
|
// endpoint/network and sandbox below will not be able to
|
||||||
|
// release ip subnets and addresses properly into the pool
|
||||||
|
// because the pools won't exist.
|
||||||
|
c.reservePools()
|
||||||
|
|
||||||
|
// Cleanup resources
|
||||||
c.sandboxCleanup()
|
c.sandboxCleanup()
|
||||||
c.cleanupLocalEndpoints()
|
c.cleanupLocalEndpoints()
|
||||||
c.networkCleanup()
|
c.networkCleanup()
|
||||||
|
|
||||||
c.reservePools()
|
|
||||||
|
|
||||||
if err := c.startExternalKeyListener(); err != nil {
|
if err := c.startExternalKeyListener(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue