mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Release address pool before removing the network from store
- On network delete it is better to release the gateway address and address pool before removing the network from the datastore, given ipam data is dependent on network data. Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
7a3601e7fd
commit
dee3acc574
1 changed files with 3 additions and 2 deletions
|
@ -603,12 +603,13 @@ func (n *network) Delete() error {
|
|||
if err = n.getController().deleteFromStore(n.getEpCnt()); err != nil {
|
||||
return fmt.Errorf("error deleting network endpoint count from store: %v", err)
|
||||
}
|
||||
|
||||
n.ipamRelease()
|
||||
|
||||
if err = n.getController().deleteFromStore(n); err != nil {
|
||||
return fmt.Errorf("error deleting network from store: %v", err)
|
||||
}
|
||||
|
||||
n.ipamRelease()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue