libnetwork icon indicating copy to clipboard operation
libnetwork copied to clipboard

Ipamutils: various cleanups and refactor

Open thaJeztah opened this issue 5 years ago • 1 comments

  • 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() and GetGlobalScopeDefaultNetworks() 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 NetworkToSplit type. 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 of init(), to allow the package to be imported without initializing these pools.

thaJeztah avatar Oct 31 '20 20:10 thaJeztah

@arkodg @cpuguy83 ptal

thaJeztah avatar Oct 31 '20 20:10 thaJeztah

  • Superseded by https://github.com/moby/moby/pull/44827

corhere avatar Mar 31 '23 21:03 corhere