1
0
Fork 0
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:
Jana Radhakrishnan 2016-06-11 19:19:16 -07:00
parent bd39ba82a4
commit a70909792a

View file

@ -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.cleanupLocalEndpoints()
c.networkCleanup()
c.reservePools()
if err := c.startExternalKeyListener(); err != nil {
return nil, err
}