From 76992f3e230458eb3d48678321cef5b54e3374c9 Mon Sep 17 00:00:00 2001 From: Shijiang Wei Date: Thu, 22 Oct 2015 18:16:53 +0800 Subject: [PATCH] remove the unused DefaultNetwork member from daemon.Config Signed-off-by: Shijiang Wei --- daemon/config.go | 37 ++++++++++++++++++------------------- daemon/daemon_test.go | 1 - daemon/daemon_unix.go | 17 ++++------------- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/daemon/config.go b/daemon/config.go index bc301a5300..9962ee74ae 100644 --- a/daemon/config.go +++ b/daemon/config.go @@ -14,25 +14,24 @@ const ( // CommonConfig defines the configuration of a docker daemon which are // common across platforms. type CommonConfig struct { - AutoRestart bool - Bridge bridgeConfig // Bridge holds bridge network specific configuration. - Context map[string][]string - DisableBridge bool - DNS []string - DNSOptions []string - DNSSearch []string - ExecOptions []string - ExecRoot string - GraphDriver string - GraphOptions []string - Labels []string - LogConfig runconfig.LogConfig - Mtu int - Pidfile string - RemappedRoot string - Root string - TrustKeyPath string - DefaultNetwork string + AutoRestart bool + Bridge bridgeConfig // Bridge holds bridge network specific configuration. + Context map[string][]string + DisableBridge bool + DNS []string + DNSOptions []string + DNSSearch []string + ExecOptions []string + ExecRoot string + GraphDriver string + GraphOptions []string + Labels []string + LogConfig runconfig.LogConfig + Mtu int + Pidfile string + RemappedRoot string + Root string + TrustKeyPath string // ClusterStore is the storage backend used for the cluster information. It is used by both // multihost networking (to store networks and endpoints information) and by the node discovery diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 919327e795..d8a032492e 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -554,7 +554,6 @@ func TestNetworkOptions(t *testing.T) { daemon := &Daemon{} dconfigCorrect := &Config{ CommonConfig: CommonConfig{ - DefaultNetwork: "netPlugin:mynet:dev", ClusterStore: "consul://localhost:8500", ClusterAdvertise: "192.168.0.1:8000", }, diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index cca5691a64..82a915ce34 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -313,19 +313,10 @@ func (daemon *Daemon) networkOptions(dconfig *Config) ([]nwconfig.Option, error) options = append(options, nwconfig.OptionDataDir(dconfig.Root)) - if strings.TrimSpace(dconfig.DefaultNetwork) != "" { - dn := strings.Split(dconfig.DefaultNetwork, ":") - if len(dn) < 2 { - return nil, fmt.Errorf("default network daemon config must be of the form NETWORKDRIVER:NETWORKNAME") - } - options = append(options, nwconfig.OptionDefaultDriver(dn[0])) - options = append(options, nwconfig.OptionDefaultNetwork(strings.Join(dn[1:], ":"))) - } else { - dd := runconfig.DefaultDaemonNetworkMode() - dn := runconfig.DefaultDaemonNetworkMode().NetworkName() - options = append(options, nwconfig.OptionDefaultDriver(string(dd))) - options = append(options, nwconfig.OptionDefaultNetwork(dn)) - } + dd := runconfig.DefaultDaemonNetworkMode() + dn := runconfig.DefaultDaemonNetworkMode().NetworkName() + options = append(options, nwconfig.OptionDefaultDriver(string(dd))) + options = append(options, nwconfig.OptionDefaultNetwork(dn)) if strings.TrimSpace(dconfig.ClusterStore) != "" { kv := strings.Split(dconfig.ClusterStore, "://")