summaryrefslogtreecommitdiff
path: root/libnetwork/cmd
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2023-01-24 18:19:26 -0500
committerCory Snider <csnider@mirantis.com>2023-01-27 11:47:42 -0500
commit28edc8e2d692cb47f1ec6bb32a6e346777e1250d (patch)
treecea33c9ef740c49dacd0bce02620b918a75ea0c9 /libnetwork/cmd
parent5595311209cc915e8b0ace0a1bbd8b52a7baecb0 (diff)
downloaddocker-28edc8e2d692cb47f1ec6bb32a6e346777e1250d.tar.gz
libnet: convert to new-style driver registration
Per the Interface Segregation Principle, network drivers should not have to depend on GetPluginGetter methods they do not use. The remote network driver is the only one which needs a PluginGetter, and it is already special-cased in Controller so there is no sense warping the interfaces to achieve a foolish consistency. Replace all other network drivers' Init functions with Register functions which take a driverapi.Registerer argument instead of a driverapi.DriverCallback. Add back in Init wrapper functions for only the drivers which Swarmkit references so that Swarmkit can continue to build. Refactor the libnetwork Controller to use the new drvregistry.Networks and drvregistry.IPAMs driver registries in place of the legacy ones. Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'libnetwork/cmd')
-rw-r--r--libnetwork/cmd/ovrouter/ovrouter.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/libnetwork/cmd/ovrouter/ovrouter.go b/libnetwork/cmd/ovrouter/ovrouter.go
index bca34d504f..faad115a4b 100644
--- a/libnetwork/cmd/ovrouter/ovrouter.go
+++ b/libnetwork/cmd/ovrouter/ovrouter.go
@@ -13,7 +13,6 @@ import (
"github.com/docker/docker/libnetwork/drivers/overlay"
"github.com/docker/docker/libnetwork/netlabel"
"github.com/docker/docker/libnetwork/types"
- "github.com/docker/docker/pkg/plugingetter"
"github.com/docker/docker/pkg/reexec"
"github.com/vishvananda/netlink"
)
@@ -28,10 +27,6 @@ type endpoint struct {
name string
}
-func (r *router) GetPluginGetter() plugingetter.PluginGetter {
- return nil
-}
-
func (r *router) RegisterDriver(name string, driver driverapi.Driver, c driverapi.Capability) error {
r.d = driver
return nil
@@ -126,7 +121,7 @@ func main() {
}
r := &router{}
- if err := overlay.Init(r, opt); err != nil {
+ if err := overlay.Register(r, opt); err != nil {
fmt.Printf("Failed to initialize overlay driver: %v\n", err)
os.Exit(1)
}