libnetwork: remove unused props from windows overlay driver

The overlay driver was creating a global store whenever
netlabel.GlobalKVClient was specified in its config argument. This
specific label is unused anymore since 142b522 (moby/moby#44875).

It was also creating a local store whenever netlabel.LocalKVClient was
specificed in its config argument. This store is unused since
moby/libnetwork@9e72136 (moby/libnetwork#1636).

Finally, the sync.Once properties are never used and thus can be
deleted.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton 2023-02-10 16:03:52 +01:00
parent 0fa873c0fe
commit c8d2c6ea77
No known key found for this signature in database
GPG key ID: 630B8E1DCBDB1864

View file

@ -11,7 +11,6 @@ import (
"github.com/docker/docker/libnetwork/datastore" "github.com/docker/docker/libnetwork/datastore"
"github.com/docker/docker/libnetwork/discoverapi" "github.com/docker/docker/libnetwork/discoverapi"
"github.com/docker/docker/libnetwork/driverapi" "github.com/docker/docker/libnetwork/driverapi"
"github.com/docker/docker/libnetwork/netlabel"
"github.com/docker/docker/libnetwork/types" "github.com/docker/docker/libnetwork/types"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -21,12 +20,8 @@ const (
) )
type driver struct { type driver struct {
config map[string]interface{} config map[string]interface{}
networks networkTable networks networkTable
store datastore.DataStore
localStore datastore.DataStore
once sync.Once
joinOnce sync.Once
sync.Mutex sync.Mutex
} }
@ -42,30 +37,6 @@ func Register(r driverapi.Registerer, config map[string]interface{}) error {
config: config, config: config,
} }
if data, ok := config[netlabel.GlobalKVClient]; ok {
var err error
dsc, ok := data.(discoverapi.DatastoreConfigData)
if !ok {
return types.InternalErrorf("incorrect data in datastore configuration: %v", data)
}
d.store, err = datastore.NewDataStoreFromConfig(dsc)
if err != nil {
return types.InternalErrorf("failed to initialize data store: %v", err)
}
}
if data, ok := config[netlabel.LocalKVClient]; ok {
var err error
dsc, ok := data.(discoverapi.DatastoreConfigData)
if !ok {
return types.InternalErrorf("incorrect data in datastore configuration: %v", data)
}
d.localStore, err = datastore.NewDataStoreFromConfig(dsc)
if err != nil {
return types.InternalErrorf("failed to initialize local data store: %v", err)
}
}
d.restoreHNSNetworks() d.restoreHNSNetworks()
return r.RegisterDriver(networkType, d, c) return r.RegisterDriver(networkType, d, c)