libnetwork/drvregistry: drop unused args

Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
Cory Snider 2023-01-23 18:05:46 -05:00
parent befff0e13f
commit 27cca19c9a
2 changed files with 6 additions and 13 deletions

View file

@ -130,7 +130,7 @@ func New(cfgOptions ...config.Option) (*Controller, error) {
return nil, err
}
drvRegistry, err := drvregistry.New(c.getStore(), nil, c.RegisterDriver, nil, c.cfg.PluginGetter)
drvRegistry, err := drvregistry.New(nil, nil, c.RegisterDriver, nil, c.cfg.PluginGetter)
if err != nil {
return nil, err
}

View file

@ -33,7 +33,6 @@ type DrvRegistry struct {
drivers driverTable
ipamDrivers ipamTable
dfn DriverNotifyFunc
ifn IPAMNotifyFunc
pluginGetter plugingetter.PluginGetter
}
@ -48,19 +47,19 @@ type IPAMWalkFunc func(name string, driver ipamapi.Ipam, cap *ipamapi.Capability
// DriverWalkFunc defines the network driver table walker function signature.
type DriverWalkFunc func(name string, driver driverapi.Driver, capability driverapi.Capability) bool
// IPAMNotifyFunc defines the notify function signature when a new IPAM driver gets registered.
type IPAMNotifyFunc func(name string, driver ipamapi.Ipam, cap *ipamapi.Capability) error
// DriverNotifyFunc defines the notify function signature when a new network driver gets registered.
type DriverNotifyFunc func(name string, driver driverapi.Driver, capability driverapi.Capability) 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 driver registry handle.
func New(lDs, gDs interface{}, dfn DriverNotifyFunc, ifn IPAMNotifyFunc, pg plugingetter.PluginGetter) (*DrvRegistry, error) {
func New(lDs, gDs Placeholder, dfn DriverNotifyFunc, ifn Placeholder, pg plugingetter.PluginGetter) (*DrvRegistry, error) {
r := &DrvRegistry{
drivers: make(driverTable),
ipamDrivers: make(ipamTable),
dfn: dfn,
ifn: ifn,
pluginGetter: pg,
}
@ -204,12 +203,6 @@ func (r *DrvRegistry) registerIpamDriver(name string, driver ipamapi.Ipam, caps
return types.InternalErrorf("ipam driver %q failed to return default address spaces: %v", name, err)
}
if r.ifn != nil {
if err := r.ifn(name, driver, caps); err != nil {
return err
}
}
r.Lock()
r.ipamDrivers[name] = &ipamData{driver: driver, defaultLocalAddressSpace: locAS, defaultGlobalAddressSpace: glbAS, capability: caps}
r.Unlock()