-
Notifications
You must be signed in to change notification settings - Fork 18.6k
/
drivers.go
31 lines (29 loc) · 986 Bytes
/
drivers.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
31
package ipams
import (
"github.com/docker/docker/libnetwork/ipamapi"
"github.com/docker/docker/libnetwork/ipams/defaultipam"
"github.com/docker/docker/libnetwork/ipams/null"
remoteIpam "github.com/docker/docker/libnetwork/ipams/remote"
"github.com/docker/docker/libnetwork/ipams/windowsipam"
"github.com/docker/docker/libnetwork/ipamutils"
"github.com/docker/docker/pkg/plugingetter"
)
// Register registers all the builtin drivers (ie. default, windowsipam, null
// and remote). If 'pg' is nil, the remote driver won't be registered.
func Register(r ipamapi.Registerer, pg plugingetter.PluginGetter, lAddrPools, gAddrPools []*ipamutils.NetworkToSplit) error {
if err := defaultipam.Register(r, lAddrPools, gAddrPools); err != nil {
return err
}
if err := windowsipam.Register(r); err != nil {
return err
}
if err := null.Register(r); err != nil {
return err
}
if pg != nil {
if err := remoteIpam.Register(r, pg); err != nil {
return err
}
}
return nil
}