libnetwork: drop legacy driver cruft
...that Swarmkit no longer needs now that it has been migrated to use the new-style driver registration APIs. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
parent
f9a83daebb
commit
5b3acc15d1
15 changed files with 19 additions and 329 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/docker/docker/libnetwork/discoverapi"
|
"github.com/docker/docker/libnetwork/discoverapi"
|
||||||
"github.com/docker/docker/pkg/plugingetter"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NetworkPluginEndpointType represents the Endpoint Type used by Plugin system
|
// NetworkPluginEndpointType represents the Endpoint Type used by Plugin system
|
||||||
|
@ -161,13 +160,6 @@ type Registerer interface {
|
||||||
RegisterDriver(name string, driver Driver, capability Capability) error
|
RegisterDriver(name string, driver Driver, capability Capability) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// DriverCallback provides a Callback interface for Drivers into LibNetwork
|
|
||||||
type DriverCallback interface {
|
|
||||||
Registerer
|
|
||||||
// GetPluginGetter returns the pluginv2 getter.
|
|
||||||
GetPluginGetter() plugingetter.PluginGetter
|
|
||||||
}
|
|
||||||
|
|
||||||
// Capability represents the high level capabilities of the drivers which libnetwork can make use of
|
// Capability represents the high level capabilities of the drivers which libnetwork can make use of
|
||||||
type Capability struct {
|
type Capability struct {
|
||||||
DataScope string
|
DataScope string
|
||||||
|
|
|
@ -11,13 +11,6 @@ const networkType = "bridge"
|
||||||
|
|
||||||
type driver struct{}
|
type driver struct{}
|
||||||
|
|
||||||
// Init registers a new instance of bridge manager driver.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
|
|
||||||
return Register(dc)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers a new instance of the bridge manager driver with r.
|
// Register registers a new instance of the bridge manager driver with r.
|
||||||
func Register(r driverapi.Registerer) error {
|
func Register(r driverapi.Registerer) error {
|
||||||
return r.RegisterDriver(networkType, &driver{}, driverapi.Capability{
|
return r.RegisterDriver(networkType, &driver{}, driverapi.Capability{
|
||||||
|
|
|
@ -16,13 +16,6 @@ type driver struct {
|
||||||
sync.Mutex
|
sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init registers a new instance of host driver.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
|
|
||||||
return Register(dc)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Register(r driverapi.Registerer) error {
|
func Register(r driverapi.Registerer) error {
|
||||||
return r.RegisterDriver(NetworkType, &driver{}, driverapi.Capability{
|
return r.RegisterDriver(NetworkType, &driver{}, driverapi.Capability{
|
||||||
DataScope: datastore.LocalScope,
|
DataScope: datastore.LocalScope,
|
||||||
|
|
|
@ -11,13 +11,6 @@ const networkType = "ipvlan"
|
||||||
|
|
||||||
type driver struct{}
|
type driver struct{}
|
||||||
|
|
||||||
// Init registers a new instance of the ipvlan manager driver.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
|
|
||||||
return Register(dc)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers a new instance of the ipvlan manager driver.
|
// Register registers a new instance of the ipvlan manager driver.
|
||||||
func Register(r driverapi.Registerer) error {
|
func Register(r driverapi.Registerer) error {
|
||||||
return r.RegisterDriver(networkType, &driver{}, driverapi.Capability{
|
return r.RegisterDriver(networkType, &driver{}, driverapi.Capability{
|
||||||
|
|
|
@ -11,13 +11,6 @@ const networkType = "macvlan"
|
||||||
|
|
||||||
type driver struct{}
|
type driver struct{}
|
||||||
|
|
||||||
// Init registers a new instance of the macvlan manager driver.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
|
|
||||||
return Register(dc)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers a new instance of the macvlan manager driver.
|
// Register registers a new instance of the macvlan manager driver.
|
||||||
func Register(r driverapi.Registerer) error {
|
func Register(r driverapi.Registerer) error {
|
||||||
return r.RegisterDriver(networkType, &driver{}, driverapi.Capability{
|
return r.RegisterDriver(networkType, &driver{}, driverapi.Capability{
|
||||||
|
|
|
@ -46,13 +46,6 @@ type network struct {
|
||||||
subnets []*subnet
|
subnets []*subnet
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init registers a new instance of the overlay driver.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
|
|
||||||
return Register(dc)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers a new instance of the overlay driver.
|
// Register registers a new instance of the overlay driver.
|
||||||
func Register(r driverapi.Registerer) error {
|
func Register(r driverapi.Registerer) error {
|
||||||
return r.RegisterDriver(networkType, newDriver(), driverapi.Capability{
|
return r.RegisterDriver(networkType, newDriver(), driverapi.Capability{
|
||||||
|
|
|
@ -29,14 +29,6 @@ func newDriver(name string, client *plugins.Client) driverapi.Driver {
|
||||||
return &driver{networkType: name, endpoint: client}
|
return &driver{networkType: name, endpoint: client}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init makes sure a remote driver is registered when a network driver
|
|
||||||
// plugin is activated.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
|
|
||||||
return Register(dc, dc.GetPluginGetter())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register makes sure a remote driver is registered with r when a network
|
// Register makes sure a remote driver is registered with r when a network
|
||||||
// driver plugin is activated.
|
// driver plugin is activated.
|
||||||
func Register(r driverapi.Registerer, pg plugingetter.PluginGetter) error {
|
func Register(r driverapi.Registerer, pg plugingetter.PluginGetter) error {
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
package drvregistry
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/docker/docker/libnetwork/driverapi"
|
|
||||||
"github.com/docker/docker/libnetwork/ipamapi"
|
|
||||||
"github.com/docker/docker/pkg/plugingetter"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DrvRegistry holds the registry of all network drivers and IPAM drivers that it knows about.
|
|
||||||
type DrvRegistry struct {
|
|
||||||
Networks
|
|
||||||
IPAMs
|
|
||||||
pluginGetter plugingetter.PluginGetter
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ driverapi.DriverCallback = (*DrvRegistry)(nil)
|
|
||||||
_ ipamapi.Callback = (*DrvRegistry)(nil)
|
|
||||||
)
|
|
||||||
|
|
||||||
// InitFunc defines the driver initialization function signature.
|
|
||||||
type InitFunc func(driverapi.DriverCallback, map[string]interface{}) error
|
|
||||||
|
|
||||||
// Placeholder is a type for function arguments which need to be present for Swarmkit
|
|
||||||
// to compile, but for which the only acceptable value is nil.
|
|
||||||
type Placeholder *struct{}
|
|
||||||
|
|
||||||
// New returns a new legacy driver registry.
|
|
||||||
//
|
|
||||||
// Deprecated: use the separate [Networks] and [IPAMs] registries.
|
|
||||||
func New(lDs, gDs Placeholder, dfn DriverNotifyFunc, ifn Placeholder, pg plugingetter.PluginGetter) (*DrvRegistry, error) {
|
|
||||||
return &DrvRegistry{
|
|
||||||
Networks: Networks{Notify: dfn},
|
|
||||||
pluginGetter: pg,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// AddDriver adds a network driver to the registry.
|
|
||||||
//
|
|
||||||
// Deprecated: call fn(r, config) directly.
|
|
||||||
func (r *DrvRegistry) AddDriver(_ string, fn InitFunc, config map[string]interface{}) error {
|
|
||||||
return fn(r, config)
|
|
||||||
}
|
|
||||||
|
|
||||||
// IPAMDefaultAddressSpaces returns the default address space strings for the passed IPAM driver name.
|
|
||||||
//
|
|
||||||
// Deprecated: call GetDefaultAddressSpaces() on the IPAM driver.
|
|
||||||
func (r *DrvRegistry) IPAMDefaultAddressSpaces(name string) (string, string, error) {
|
|
||||||
d, _ := r.IPAM(name)
|
|
||||||
|
|
||||||
if d == nil {
|
|
||||||
return "", "", fmt.Errorf("ipam %s not found", name)
|
|
||||||
}
|
|
||||||
|
|
||||||
return d.GetDefaultAddressSpaces()
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPluginGetter returns the plugingetter
|
|
||||||
func (r *DrvRegistry) GetPluginGetter() plugingetter.PluginGetter {
|
|
||||||
return r.pluginGetter
|
|
||||||
}
|
|
||||||
|
|
||||||
// Driver returns the network driver instance registered under name, and its capability.
|
|
||||||
func (r *DrvRegistry) Driver(name string) (driverapi.Driver, *driverapi.Capability) {
|
|
||||||
d, c := r.Networks.Driver(name)
|
|
||||||
|
|
||||||
if c == (driverapi.Capability{}) {
|
|
||||||
return d, nil
|
|
||||||
}
|
|
||||||
return d, &c
|
|
||||||
}
|
|
|
@ -1,147 +0,0 @@
|
||||||
package drvregistry
|
|
||||||
|
|
||||||
import (
|
|
||||||
"runtime"
|
|
||||||
"sort"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/docker/docker/libnetwork/datastore"
|
|
||||||
"github.com/docker/docker/libnetwork/driverapi"
|
|
||||||
"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"
|
|
||||||
"gotest.tools/v3/assert"
|
|
||||||
is "gotest.tools/v3/assert/cmp"
|
|
||||||
)
|
|
||||||
|
|
||||||
const mockDriverName = "mock-driver"
|
|
||||||
|
|
||||||
type mockDriver struct {
|
|
||||||
driverapi.Driver
|
|
||||||
}
|
|
||||||
|
|
||||||
var mockDriverCaps = driverapi.Capability{DataScope: datastore.LocalScope}
|
|
||||||
|
|
||||||
var md = mockDriver{}
|
|
||||||
|
|
||||||
func mockDriverInit(reg driverapi.DriverCallback, opt map[string]interface{}) error {
|
|
||||||
return reg.RegisterDriver(mockDriverName, &md, mockDriverCaps)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *mockDriver) Type() string {
|
|
||||||
return mockDriverName
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *mockDriver) IsBuiltIn() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func getNew(t *testing.T) *DrvRegistry {
|
|
||||||
reg, err := New(nil, nil, nil, nil, nil)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = initIPAMDrivers(reg)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
return reg
|
|
||||||
}
|
|
||||||
|
|
||||||
func initIPAMDrivers(r *DrvRegistry) error {
|
|
||||||
for _, fn := range [](func(ipamapi.Callback, interface{}, interface{}) error){
|
|
||||||
builtinIpam.Init, //nolint:staticcheck
|
|
||||||
remoteIpam.Init, //nolint:staticcheck
|
|
||||||
nullIpam.Init, //nolint:staticcheck
|
|
||||||
} {
|
|
||||||
if err := fn(r, nil, nil); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestNew(t *testing.T) {
|
|
||||||
getNew(t)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAddDriver(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
err := reg.AddDriver(mockDriverName, mockDriverInit, nil)
|
|
||||||
assert.NilError(t, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAddDuplicateDriver(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
err := reg.AddDriver(mockDriverName, mockDriverInit, nil)
|
|
||||||
assert.NilError(t, err)
|
|
||||||
|
|
||||||
// Try adding the same driver
|
|
||||||
err = reg.AddDriver(mockDriverName, mockDriverInit, nil)
|
|
||||||
assert.Check(t, is.ErrorContains(err, ""))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestIPAMDefaultAddressSpaces(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
as1, as2, err := reg.IPAMDefaultAddressSpaces("default")
|
|
||||||
assert.NilError(t, err)
|
|
||||||
assert.Check(t, as1 != "")
|
|
||||||
assert.Check(t, as2 != "")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDriver(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
err := reg.AddDriver(mockDriverName, mockDriverInit, nil)
|
|
||||||
assert.NilError(t, err)
|
|
||||||
|
|
||||||
d, cap := reg.Driver(mockDriverName)
|
|
||||||
assert.Check(t, d != nil)
|
|
||||||
assert.Check(t, cap != nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestIPAM(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
i, cap := reg.IPAM("default")
|
|
||||||
assert.Check(t, i != nil)
|
|
||||||
assert.Check(t, cap != nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWalkIPAMs(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
ipams := make([]string, 0, 2)
|
|
||||||
reg.WalkIPAMs(func(name string, driver ipamapi.Ipam, cap *ipamapi.Capability) bool {
|
|
||||||
ipams = append(ipams, name)
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
sort.Strings(ipams)
|
|
||||||
expected := []string{"default", "null"}
|
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
expected = append(expected, "windows")
|
|
||||||
}
|
|
||||||
assert.Check(t, is.DeepEqual(ipams, expected))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWalkDrivers(t *testing.T) {
|
|
||||||
reg := getNew(t)
|
|
||||||
|
|
||||||
err := reg.AddDriver(mockDriverName, mockDriverInit, nil)
|
|
||||||
assert.NilError(t, err)
|
|
||||||
|
|
||||||
var driverName string
|
|
||||||
reg.WalkDrivers(func(name string, driver driverapi.Driver, capability driverapi.Capability) bool {
|
|
||||||
driverName = name
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
assert.Check(t, is.Equal(driverName, mockDriverName))
|
|
||||||
}
|
|
|
@ -3,11 +3,30 @@ package drvregistry
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/docker/docker/libnetwork/datastore"
|
||||||
"github.com/docker/docker/libnetwork/driverapi"
|
"github.com/docker/docker/libnetwork/driverapi"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const mockDriverName = "mock-driver"
|
||||||
|
|
||||||
|
type mockDriver struct {
|
||||||
|
driverapi.Driver
|
||||||
|
}
|
||||||
|
|
||||||
|
var mockDriverCaps = driverapi.Capability{DataScope: datastore.LocalScope}
|
||||||
|
|
||||||
|
var md = mockDriver{}
|
||||||
|
|
||||||
|
func (m *mockDriver) Type() string {
|
||||||
|
return mockDriverName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mockDriver) IsBuiltIn() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func TestNetworks(t *testing.T) {
|
func TestNetworks(t *testing.T) {
|
||||||
t.Run("RegisterDriver", func(t *testing.T) {
|
t.Run("RegisterDriver", func(t *testing.T) {
|
||||||
var reg Networks
|
var reg Networks
|
||||||
|
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/docker/docker/libnetwork/types"
|
"github.com/docker/docker/libnetwork/types"
|
||||||
"github.com/docker/docker/pkg/plugingetter"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// IPAM plugin types
|
// IPAM plugin types
|
||||||
|
@ -28,15 +27,6 @@ type Registerer interface {
|
||||||
RegisterIpamDriverWithCapabilities(name string, driver Ipam, capability *Capability) error
|
RegisterIpamDriverWithCapabilities(name string, driver Ipam, capability *Capability) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Callback is a legacy interface for registering an IPAM instance into LibNetwork.
|
|
||||||
//
|
|
||||||
// The narrower [Registerer] interface is preferred for new code.
|
|
||||||
type Callback interface {
|
|
||||||
Registerer
|
|
||||||
// GetPluginGetter returns the pluginv2 getter.
|
|
||||||
GetPluginGetter() plugingetter.PluginGetter
|
|
||||||
}
|
|
||||||
|
|
||||||
// Well-known errors returned by IPAM
|
// Well-known errors returned by IPAM
|
||||||
var (
|
var (
|
||||||
ErrIpamInternalError = types.InternalErrorf("IPAM Internal Error")
|
ErrIpamInternalError = types.InternalErrorf("IPAM Internal Error")
|
||||||
|
|
|
@ -3,26 +3,9 @@
|
||||||
package builtin
|
package builtin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
|
|
||||||
"github.com/docker/docker/libnetwork/ipamapi"
|
"github.com/docker/docker/libnetwork/ipamapi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Init registers the built-in ipam service with libnetwork
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(ic ipamapi.Callback, l, g interface{}) error {
|
|
||||||
if l != nil {
|
|
||||||
return errors.New("non-nil local datastore passed to built-in ipam init")
|
|
||||||
}
|
|
||||||
|
|
||||||
if g != nil {
|
|
||||||
return errors.New("non-nil global datastore passed to built-in ipam init")
|
|
||||||
}
|
|
||||||
|
|
||||||
return Register(ic)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers the built-in ipam service with libnetwork.
|
// Register registers the built-in ipam service with libnetwork.
|
||||||
func Register(r ipamapi.Registerer) error {
|
func Register(r ipamapi.Registerer) error {
|
||||||
return registerBuiltin(r)
|
return registerBuiltin(r)
|
||||||
|
|
|
@ -3,27 +3,10 @@
|
||||||
package builtin
|
package builtin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
|
|
||||||
"github.com/docker/docker/libnetwork/ipamapi"
|
"github.com/docker/docker/libnetwork/ipamapi"
|
||||||
"github.com/docker/docker/libnetwork/ipams/windowsipam"
|
"github.com/docker/docker/libnetwork/ipams/windowsipam"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Init registers the built-in ipam services with libnetwork.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(ic ipamapi.Callback, l, g interface{}) error {
|
|
||||||
if l != nil {
|
|
||||||
return errors.New("non-nil local datastore passed to built-in ipam init")
|
|
||||||
}
|
|
||||||
|
|
||||||
if g != nil {
|
|
||||||
return errors.New("non-nil global datastore passed to built-in ipam init")
|
|
||||||
}
|
|
||||||
|
|
||||||
return Register(ic)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers the built-in ipam services with libnetwork.
|
// Register registers the built-in ipam services with libnetwork.
|
||||||
func Register(r ipamapi.Registerer) error {
|
func Register(r ipamapi.Registerer) error {
|
||||||
if err := registerBuiltin(r); err != nil {
|
if err := registerBuiltin(r); err != nil {
|
||||||
|
|
|
@ -69,13 +69,6 @@ func (a *allocator) IsBuiltIn() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init registers the null ipam driver with ic.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(ic ipamapi.Callback, l, g interface{}) error {
|
|
||||||
return Register(ic)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers the null ipam driver with r.
|
// Register registers the null ipam driver with r.
|
||||||
func Register(r ipamapi.Registerer) error {
|
func Register(r ipamapi.Registerer) error {
|
||||||
return r.RegisterIpamDriver(ipamapi.NullIPAM, &allocator{})
|
return r.RegisterIpamDriver(ipamapi.NullIPAM, &allocator{})
|
||||||
|
|
|
@ -31,13 +31,6 @@ func newAllocator(name string, client *plugins.Client) ipamapi.Ipam {
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init registers a remote ipam when its plugin is activated.
|
|
||||||
//
|
|
||||||
// Deprecated: use [Register].
|
|
||||||
func Init(cb ipamapi.Callback, l, g interface{}) error {
|
|
||||||
return Register(cb, cb.GetPluginGetter())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register registers a remote ipam when its plugin is activated.
|
// Register registers a remote ipam when its plugin is activated.
|
||||||
func Register(cb ipamapi.Registerer, pg plugingetter.PluginGetter) error {
|
func Register(cb ipamapi.Registerer, pg plugingetter.PluginGetter) error {
|
||||||
newPluginHandler := func(name string, client *plugins.Client) {
|
newPluginHandler := func(name string, client *plugins.Client) {
|
||||||
|
|
Loading…
Reference in a new issue