docker/config: update -mtu flag default

Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: google)
This commit is contained in:
Johan Euphrosine 2014-02-03 15:36:39 -08:00
parent 1b9c5edc6c
commit 92e61f89aa
3 changed files with 7 additions and 6 deletions

View File

@ -49,7 +49,7 @@ func DaemonConfigFromJob(job *engine.Job) *DaemonConfig {
if mtu := job.GetenvInt("Mtu"); mtu != 0 { if mtu := job.GetenvInt("Mtu"); mtu != 0 {
config.Mtu = mtu config.Mtu = mtu
} else { } else {
config.Mtu = DefaultNetworkMtu config.Mtu = GetDefaultNetworkMtu()
} }
config.DisableNetwork = job.Getenv("BridgeIface") == DisableNetworkBridge config.DisableNetwork = job.Getenv("BridgeIface") == DisableNetworkBridge

View File

@ -43,7 +43,7 @@ func main() {
flInterContainerComm = flag.Bool([]string{"#icc", "-icc"}, true, "Enable inter-container communication") 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") flGraphDriver = flag.String([]string{"s", "-storage-driver"}, "", "Force the docker runtime to use a specific storage driver")
flHosts = docker.NewListOpts(docker.ValidateHost) 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(&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") 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")

View File

@ -4,9 +4,6 @@ import (
"archive/tar" "archive/tar"
"bytes" "bytes"
"fmt" "fmt"
"github.com/dotcloud/docker"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/utils"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -16,6 +13,10 @@ import (
"strings" "strings"
"testing" "testing"
"time" "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. // 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{ config := &docker.DaemonConfig{
Root: root, Root: root,
AutoRestart: false, AutoRestart: false,
Mtu: docker.DefaultNetworkMtu, Mtu: docker.GetDefaultNetworkMtu(),
} }
eng, err := engine.New(root) eng, err := engine.New(root)