Create constant for 'weave' network name and move inside if-statement for weavemesh

This commit is contained in:
Bryan Boreham committed 2017-05-17 09:27:40 +00:00
1 parent 77201e949d
commit 280651da9c
1 file changed
+6 -5
+6 -5
View File
@@ -18,6 +18,7 @@ import (
const (
pluginV2Name = "net-plugin"
defaultNetwork = "weave"
MulticastOption = netplugin.MulticastOption
)
@@ -53,11 +54,11 @@ func run(dockerClient *docker.Client, weave *weaveapi.Client, address, meshAddre
}
defer os.Remove(meshAddress)
defer meshListener.Close()
}
if !isPluginV2 {
Log.Println("Creating default 'weave' network")
options := map[string]interface{}{MulticastOption: "true"}
dockerClient.EnsureNetwork("weave", pluginNameFromAddress(meshAddress), defaultSubnet, options)
if !isPluginV2 {
Log.Printf("Creating default %q network", defaultNetwork)
options := map[string]interface{}{MulticastOption: "true"}
dockerClient.EnsureNetwork(defaultNetwork, pluginNameFromAddress(meshAddress), defaultSubnet, options)
}
}
ready()