Skip to content

Commit c8d2c6e

Browse files
committed
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#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 <[email protected]>
1 parent 0fa873c commit c8d2c6e

1 file changed

Lines changed: 2 additions & 31 deletions

File tree

libnetwork/drivers/windows/overlay/overlay_windows.go

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/docker/docker/libnetwork/datastore"
1212
"github.com/docker/docker/libnetwork/discoverapi"
1313
"github.com/docker/docker/libnetwork/driverapi"
14-
"github.com/docker/docker/libnetwork/netlabel"
1514
"github.com/docker/docker/libnetwork/types"
1615
"github.com/sirupsen/logrus"
1716
)
@@ -21,12 +20,8 @@ const (
2120
)
2221

2322
type driver struct {
24-
config map[string]interface{}
25-
networks networkTable
26-
store datastore.DataStore
27-
localStore datastore.DataStore
28-
once sync.Once
29-
joinOnce sync.Once
23+
config map[string]interface{}
24+
networks networkTable
3025
sync.Mutex
3126
}
3227

@@ -42,30 +37,6 @@ func Register(r driverapi.Registerer, config map[string]interface{}) error {
4237
config: config,
4338
}
4439

45-
if data, ok := config[netlabel.GlobalKVClient]; ok {
46-
var err error
47-
dsc, ok := data.(discoverapi.DatastoreConfigData)
48-
if !ok {
49-
return types.InternalErrorf("incorrect data in datastore configuration: %v", data)
50-
}
51-
d.store, err = datastore.NewDataStoreFromConfig(dsc)
52-
if err != nil {
53-
return types.InternalErrorf("failed to initialize data store: %v", err)
54-
}
55-
}
56-
57-
if data, ok := config[netlabel.LocalKVClient]; ok {
58-
var err error
59-
dsc, ok := data.(discoverapi.DatastoreConfigData)
60-
if !ok {
61-
return types.InternalErrorf("incorrect data in datastore configuration: %v", data)
62-
}
63-
d.localStore, err = datastore.NewDataStoreFromConfig(dsc)
64-
if err != nil {
65-
return types.InternalErrorf("failed to initialize local data store: %v", err)
66-
}
67-
}
68-
6940
d.restoreHNSNetworks()
7041

7142
return r.RegisterDriver(networkType, d, c)

0 commit comments

Comments
 (0)