Signed-off-by: Madhu Venugopal <madhu@docker.com>
| ... | ... |
@@ -23,7 +23,7 @@ github.com/RackSec/srslog 456df3a81436d29ba874f3590eeeee25d666f8a5 |
| 23 | 23 |
github.com/imdario/mergo 0.2.1 |
| 24 | 24 |
|
| 25 | 25 |
#get libnetwork packages |
| 26 |
-github.com/docker/libnetwork 4df06c4a7d9b67d0948eab39c5d013d7296acdbf |
|
| 26 |
+github.com/docker/libnetwork b908488a139e81cb8c4091cd836745aeb4d813a4 |
|
| 27 | 27 |
github.com/docker/go-events 18b43f1bc85d9cdd42c05a6cd2d444c7a200a894 |
| 28 | 28 |
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80 |
| 29 | 29 |
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec |
| ... | ... |
@@ -35,6 +35,7 @@ type Config struct {
|
| 35 | 35 |
// DaemonCfg represents libnetwork core configuration |
| 36 | 36 |
type DaemonCfg struct {
|
| 37 | 37 |
Debug bool |
| 38 |
+ Experimental bool |
|
| 38 | 39 |
DataDir string |
| 39 | 40 |
DefaultNetwork string |
| 40 | 41 |
DefaultDriver string |
| ... | ... |
@@ -222,6 +223,14 @@ func OptionPluginGetter(pg plugingetter.PluginGetter) Option {
|
| 222 | 222 |
} |
| 223 | 223 |
} |
| 224 | 224 |
|
| 225 |
+// OptionExperimental function returns an option setter for experimental daemon |
|
| 226 |
+func OptionExperimental(exp bool) Option {
|
|
| 227 |
+ return func(c *Config) {
|
|
| 228 |
+ logrus.Debugf("Option Experimental: %v", exp)
|
|
| 229 |
+ c.Daemon.Experimental = exp |
|
| 230 |
+ } |
|
| 231 |
+} |
|
| 232 |
+ |
|
| 225 | 233 |
// ProcessOptions processes options and stores it in config |
| 226 | 234 |
func (c *Config) ProcessOptions(options ...Option) {
|
| 227 | 235 |
for _, opt := range options {
|
| ... | ... |
@@ -188,7 +188,7 @@ func New(cfgOptions ...config.Option) (NetworkController, error) {
|
| 188 | 188 |
return nil, err |
| 189 | 189 |
} |
| 190 | 190 |
|
| 191 |
- for _, i := range getInitializers() {
|
|
| 191 |
+ for _, i := range getInitializers(c.cfg.Daemon.Experimental) {
|
|
| 192 | 192 |
var dcfg map[string]interface{}
|
| 193 | 193 |
|
| 194 | 194 |
// External plugins don't need config passed through daemon. They can |
| ... | ... |
@@ -476,7 +476,7 @@ func (c *controller) ID() string {
|
| 476 | 476 |
|
| 477 | 477 |
func (c *controller) BuiltinDrivers() []string {
|
| 478 | 478 |
drivers := []string{}
|
| 479 |
- for _, i := range getInitializers() {
|
|
| 479 |
+ for _, i := range getInitializers(c.cfg.Daemon.Experimental) {
|
|
| 480 | 480 |
if i.ntype == "remote" {
|
| 481 | 481 |
continue |
| 482 | 482 |
} |
| ... | ... |
@@ -9,7 +9,7 @@ import ( |
| 9 | 9 |
"github.com/docker/libnetwork/drivers/remote" |
| 10 | 10 |
) |
| 11 | 11 |
|
| 12 |
-func getInitializers() []initializer {
|
|
| 12 |
+func getInitializers(experimental bool) []initializer {
|
|
| 13 | 13 |
in := []initializer{
|
| 14 | 14 |
{bridge.Init, "bridge"},
|
| 15 | 15 |
{host.Init, "host"},
|
| ... | ... |
@@ -19,6 +19,8 @@ func getInitializers() []initializer {
|
| 19 | 19 |
{overlay.Init, "overlay"},
|
| 20 | 20 |
} |
| 21 | 21 |
|
| 22 |
- in = append(in, additionalDrivers()...) |
|
| 22 |
+ if experimental {
|
|
| 23 |
+ in = append(in, additionalDrivers()...) |
|
| 24 |
+ } |
|
| 23 | 25 |
return in |
| 24 | 26 |
} |