Преглед на файлове

libnetwork/drvregistry: drop unused args

Signed-off-by: Cory Snider <csnider@mirantis.com>
Cory Snider преди 2 години
родител
ревизия
27cca19c9a
променени са 2 файла, в които са добавени 6 реда и са изтрити 13 реда
  1. 1 1
      libnetwork/controller.go
  2. 5 12
      libnetwork/drvregistry/drvregistry.go

+ 1 - 1
libnetwork/controller.go

@@ -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
 	}

+ 5 - 12
libnetwork/drvregistry/drvregistry.go

@@ -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()