libnetwork
libnetwork copied to clipboard
Ipamutils: various cleanups and refactor
- ipamutils: use RWMutex to allow concurrent reads
- ipamutils: reformat for readability, and improve godoc
- ipamutils: un-export global variables, and use accessors instead
The
GetLocalScopeDefaultNetworks()andGetGlobalScopeDefaultNetworks()protect these variables with a lock, but various parts in the code were directly accessing the variables without locks. - ipamutils: generate default pools on first use, instead of init()
This package defines the
NetworkToSplittype. Curently importing the package also initializes the default address pools (which may not be needed, e.g., when used in the client. This patch changes initialization to happen on first use, instead ofinit(), to allow the package to be imported without initializing these pools.
@arkodg @cpuguy83 ptal
- Superseded by https://github.com/moby/moby/pull/44827