From 92e61f89aad35c3103e0db1c6dacecc0c588bd2e Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Mon, 3 Feb 2014 15:36:39 -0800 Subject: [PATCH] docker/config: update -mtu flag default Docker-DCO-1.1-Signed-off-by: Johan Euphrosine (github: google) --- config.go | 2 +- docker/docker.go | 2 +- integration/utils_test.go | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index e7f87ace77..fc04c9ff16 100644 --- a/config.go +++ b/config.go @@ -49,7 +49,7 @@ func DaemonConfigFromJob(job *engine.Job) *DaemonConfig { if mtu := job.GetenvInt("Mtu"); mtu != 0 { config.Mtu = mtu } else { - config.Mtu = DefaultNetworkMtu + config.Mtu = GetDefaultNetworkMtu() } config.DisableNetwork = job.Getenv("BridgeIface") == DisableNetworkBridge diff --git a/docker/docker.go b/docker/docker.go index 8d4ae7fce7..d92f4d98ea 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -43,7 +43,7 @@ func main() { flInterContainerComm = flag.Bool([]string{"#icc", "-icc"}, true, "Enable inter-container communication") flGraphDriver = flag.String([]string{"s", "-storage-driver"}, "", "Force the docker runtime to use a specific storage driver") flHosts = docker.NewListOpts(docker.ValidateHost) - flMtu = flag.Int([]string{"#mtu", "-mtu"}, docker.GetDefaultNetworkMtu(), "Set the containers network mtu") + flMtu = flag.Int([]string{"#mtu", "-mtu"}, 0, "Set the containers network MTU; if no value is provided: default to the default route MTU or 1500 if not default route is available") ) flag.Var(&flDns, []string{"#dns", "-dns"}, "Force docker to use specific DNS servers") flag.Var(&flHosts, []string{"H", "-host"}, "tcp://host:port, unix://path/to/socket, fd://* or fd://socketfd to use in daemon mode. Multiple sockets can be specified") diff --git a/integration/utils_test.go b/integration/utils_test.go index 060a447131..450cb7527f 100644 --- a/integration/utils_test.go +++ b/integration/utils_test.go @@ -4,9 +4,6 @@ import ( "archive/tar" "bytes" "fmt" - "github.com/dotcloud/docker" - "github.com/dotcloud/docker/engine" - "github.com/dotcloud/docker/utils" "io" "io/ioutil" "net/http" @@ -16,6 +13,10 @@ import ( "strings" "testing" "time" + + "github.com/dotcloud/docker" + "github.com/dotcloud/docker/engine" + "github.com/dotcloud/docker/utils" ) // This file contains utility functions for docker's unit test suite. @@ -32,7 +33,7 @@ func mkRuntime(f utils.Fataler) *docker.Runtime { config := &docker.DaemonConfig{ Root: root, AutoRestart: false, - Mtu: docker.DefaultNetworkMtu, + Mtu: docker.GetDefaultNetworkMtu(), } eng, err := engine.New(root)