mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
getAllNetworks unnecessary walks all the networks
- libnetwork controller Networks() already returns a copy list. Also Networks() correctly skips any network which ahs already been marked for deletion while getNetworks implementation bypass this. Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
e07c392c49
commit
5d71cc01b6
1 changed files with 1 additions and 9 deletions
|
@ -96,15 +96,7 @@ func (daemon *Daemon) GetNetworksByID(partialID string) []libnetwork.Network {
|
||||||
|
|
||||||
// getAllNetworks returns a list containing all networks
|
// getAllNetworks returns a list containing all networks
|
||||||
func (daemon *Daemon) getAllNetworks() []libnetwork.Network {
|
func (daemon *Daemon) getAllNetworks() []libnetwork.Network {
|
||||||
c := daemon.netController
|
return daemon.netController.Networks()
|
||||||
list := []libnetwork.Network{}
|
|
||||||
l := func(nw libnetwork.Network) bool {
|
|
||||||
list = append(list, nw)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
c.WalkNetworks(l)
|
|
||||||
|
|
||||||
return list
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isIngressNetwork(name string) bool {
|
func isIngressNetwork(name string) bool {
|
||||||
|
|
Loading…
Reference in a new issue