libnetwork/drivers: remove unused "config" parameters and fields

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-06-30 13:13:13 +02:00
parent d547477bc2
commit a718ccd0c5
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
8 changed files with 19 additions and 23 deletions

View file

@ -14,12 +14,12 @@ type driver struct{}
// Init registers a new instance of bridge manager driver. // Init registers a new instance of bridge manager driver.
// //
// Deprecated: use [Register]. // Deprecated: use [Register].
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
return Register(dc, config) return Register(dc, nil)
} }
// 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, config map[string]interface{}) error { func Register(r driverapi.Registerer, _ map[string]interface{}) error {
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.LocalScope, DataScope: datastore.LocalScope,
ConnectivityScope: datastore.LocalScope, ConnectivityScope: datastore.LocalScope,

View file

@ -19,11 +19,11 @@ type driver struct {
// Init registers a new instance of host driver. // Init registers a new instance of host driver.
// //
// Deprecated: use [Register]. // Deprecated: use [Register].
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
return Register(dc, config) return Register(dc, nil)
} }
func Register(r driverapi.Registerer, config map[string]interface{}) error { func Register(r driverapi.Registerer, _ map[string]interface{}) error {
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.LocalScope, DataScope: datastore.LocalScope,
ConnectivityScope: datastore.LocalScope, ConnectivityScope: datastore.LocalScope,

View file

@ -14,12 +14,12 @@ type driver struct{}
// Init registers a new instance of the ipvlan manager driver. // Init registers a new instance of the ipvlan manager driver.
// //
// Deprecated: use [Register]. // Deprecated: use [Register].
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
return Register(dc, config) return Register(dc, nil)
} }
// 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, config map[string]interface{}) error { func Register(r driverapi.Registerer, _ map[string]interface{}) error {
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.LocalScope, DataScope: datastore.LocalScope,
ConnectivityScope: datastore.GlobalScope, ConnectivityScope: datastore.GlobalScope,

View file

@ -14,12 +14,12 @@ type driver struct{}
// Init registers a new instance of the macvlan manager driver. // Init registers a new instance of the macvlan manager driver.
// //
// Deprecated: use [Register]. // Deprecated: use [Register].
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
return Register(dc, config) return Register(dc, nil)
} }
// 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, config map[string]interface{}) error { func Register(r driverapi.Registerer, _ map[string]interface{}) error {
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.LocalScope, DataScope: datastore.LocalScope,
ConnectivityScope: datastore.GlobalScope, ConnectivityScope: datastore.GlobalScope,

View file

@ -17,7 +17,7 @@ type driver struct {
} }
// Register registers a new instance of the null driver. // Register registers a new instance of the null driver.
func Register(r driverapi.Registerer, config map[string]interface{}) error { func Register(r driverapi.Registerer, _ map[string]interface{}) error {
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.LocalScope, DataScope: datastore.LocalScope,
} }

View file

@ -26,7 +26,6 @@ const (
type networkTable map[string]*network type networkTable map[string]*network
type driver struct { type driver struct {
config map[string]interface{}
networks networkTable networks networkTable
vxlanIdm *idm.Idm vxlanIdm *idm.Idm
sync.Mutex sync.Mutex
@ -48,12 +47,12 @@ type network struct {
// Init registers a new instance of the overlay driver. // Init registers a new instance of the overlay driver.
// //
// Deprecated: use [Register]. // Deprecated: use [Register].
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
return Register(dc, config) return Register(dc, nil)
} }
// Register registers a new instance of the overlay driver. // Register registers a new instance of the overlay driver.
func Register(r driverapi.DriverCallback, config map[string]interface{}) error { func Register(r driverapi.DriverCallback, _ map[string]interface{}) error {
var err error var err error
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.GlobalScope, DataScope: datastore.GlobalScope,
@ -62,7 +61,6 @@ func Register(r driverapi.DriverCallback, config map[string]interface{}) error {
d := &driver{ d := &driver{
networks: networkTable{}, networks: networkTable{},
config: config,
} }
d.vxlanIdm, err = idm.New(nil, "vxlan-id", 0, vxlanIDEnd) d.vxlanIdm, err = idm.New(nil, "vxlan-id", 0, vxlanIDEnd)

View file

@ -33,7 +33,7 @@ func newDriver(name string, client *plugins.Client) driverapi.Driver {
// plugin is activated. // plugin is activated.
// //
// Deprecated: use [Register]. // Deprecated: use [Register].
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error { func Init(dc driverapi.DriverCallback, _ map[string]interface{}) error {
return Register(dc, dc.GetPluginGetter()) return Register(dc, dc.GetPluginGetter())
} }

View file

@ -21,13 +21,12 @@ const (
) )
type driver struct { type driver struct {
config map[string]interface{}
networks networkTable networks networkTable
sync.Mutex sync.Mutex
} }
// Register registers a new instance of the overlay driver. // Register registers a new instance of the overlay driver.
func Register(r driverapi.Registerer, config map[string]interface{}) error { func Register(r driverapi.Registerer, _ map[string]interface{}) error {
c := driverapi.Capability{ c := driverapi.Capability{
DataScope: datastore.GlobalScope, DataScope: datastore.GlobalScope,
ConnectivityScope: datastore.GlobalScope, ConnectivityScope: datastore.GlobalScope,
@ -35,7 +34,6 @@ func Register(r driverapi.Registerer, config map[string]interface{}) error {
d := &driver{ d := &driver{
networks: networkTable{}, networks: networkTable{},
config: config,
} }
d.restoreHNSNetworks() d.restoreHNSNetworks()
@ -64,7 +62,7 @@ func (d *driver) restoreHNSNetworks() error {
// We assume that any network will be recreated on daemon restart // We assume that any network will be recreated on daemon restart
// and therefore don't restore hns endpoints for now // and therefore don't restore hns endpoints for now
// //
//n.restoreNetworkEndpoints() // n.restoreNetworkEndpoints()
} }
return nil return nil