28edc8e2d6
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>
21 lines
628 B
Go
21 lines
628 B
Go
package libnetwork
|
|
|
|
import (
|
|
"github.com/docker/docker/libnetwork/drivers/null"
|
|
"github.com/docker/docker/libnetwork/drivers/windows"
|
|
"github.com/docker/docker/libnetwork/drivers/windows/overlay"
|
|
)
|
|
|
|
func getInitializers() []initializer {
|
|
return []initializer{
|
|
{null.Register, "null"},
|
|
{overlay.Register, "overlay"},
|
|
{windows.GetInit("transparent"), "transparent"},
|
|
{windows.GetInit("l2bridge"), "l2bridge"},
|
|
{windows.GetInit("l2tunnel"), "l2tunnel"},
|
|
{windows.GetInit("nat"), "nat"},
|
|
{windows.GetInit("internal"), "internal"},
|
|
{windows.GetInit("private"), "private"},
|
|
{windows.GetInit("ics"), "ics"},
|
|
}
|
|
}
|