summaryrefslogtreecommitdiff
path: root/libnetwork/drivers_linux.go
diff options
context:
space:
mode:
authorJana Radhakrishnan <mrjana@docker.com>2015-09-18 14:00:36 -0700
committerJana Radhakrishnan <mrjana@docker.com>2015-09-19 08:43:34 -0700
commitd565a4df48edafa3b44230031603c24047d5ad74 (patch)
tree5cfc2b2782c10a10096dd4fb686dc63662e29bc1 /libnetwork/drivers_linux.go
parentcdd2ba4ea47ee598861fcaa8070edf0a48fa23ce (diff)
downloaddocker-d565a4df48edafa3b44230031603c24047d5ad74.tar.gz
Push driver config during `Init`
Currently the driver configuration is pushed through a separate api. This makes driver configuration possible at any arbitrary time. This unncessarily complicates the driver implementation. More importantly the driver does not get access to it's configuration before it can do the handshake with libnetwork. This make the internal drivers a little bit different to external plugins which can get their configuration before the handshake with libnetwork. This PR attempts to fix that mismatch between internal drivers and external plugins. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Diffstat (limited to 'libnetwork/drivers_linux.go')
-rw-r--r--libnetwork/drivers_linux.go22
1 files changed, 8 insertions, 14 deletions
diff --git a/libnetwork/drivers_linux.go b/libnetwork/drivers_linux.go
index b8294d452e..4d31b986c2 100644
--- a/libnetwork/drivers_linux.go
+++ b/libnetwork/drivers_linux.go
@@ -1,25 +1,19 @@
package libnetwork
import (
- "github.com/docker/libnetwork/driverapi"
"github.com/docker/libnetwork/drivers/bridge"
"github.com/docker/libnetwork/drivers/host"
"github.com/docker/libnetwork/drivers/null"
- o "github.com/docker/libnetwork/drivers/overlay"
+ "github.com/docker/libnetwork/drivers/overlay"
"github.com/docker/libnetwork/drivers/remote"
)
-func initDrivers(dc driverapi.DriverCallback) error {
- for _, fn := range [](func(driverapi.DriverCallback) error){
- bridge.Init,
- host.Init,
- null.Init,
- remote.Init,
- o.Init,
- } {
- if err := fn(dc); err != nil {
- return err
- }
+func getInitializers() []initializer {
+ return []initializer{
+ {bridge.Init, "bridge"},
+ {host.Init, "host"},
+ {null.Init, "null"},
+ {remote.Init, "remote"},
+ {overlay.Init, "overlay"},
}
- return nil
}