-
Notifications
You must be signed in to change notification settings - Fork 0
/
drivers_ipam.go
30 lines (26 loc) · 970 Bytes
/
drivers_ipam.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package libnetwork
import (
"github.com/docker/docker/libnetwork/ipamapi"
builtinIpam "github.com/docker/docker/libnetwork/ipams/builtin"
nullIpam "github.com/docker/docker/libnetwork/ipams/null"
remoteIpam "github.com/docker/docker/libnetwork/ipams/remote"
"github.com/docker/docker/libnetwork/ipamutils"
"github.com/docker/docker/pkg/plugingetter"
)
func initIPAMDrivers(r ipamapi.Registerer, pg plugingetter.PluginGetter, addressPool []*ipamutils.NetworkToSplit) error {
// TODO: pass address pools as arguments to builtinIpam.Init instead of
// indirectly through global mutable state. Swarmkit references that
// function so changing its signature breaks the build.
if err := builtinIpam.SetDefaultIPAddressPool(addressPool); err != nil {
return err
}
for _, fn := range [](func(ipamapi.Registerer) error){
builtinIpam.Register,
nullIpam.Register,
} {
if err := fn(r); err != nil {
return err
}
}
return remoteIpam.Register(r, pg)
}