From d3af5e3d4bc0aadf25d571835893a9d5bead56b3 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Thu, 21 Jul 2016 16:13:10 -0700 Subject: [PATCH] Daemon changes to pass exec-root to libnetwork This is required to make the libnetwork's namespace mgmt directory configurable Signed-off-by: Madhu Venugopal --- daemon/config_solaris.go | 4 ++++ daemon/config_unix.go | 5 +++++ daemon/config_windows.go | 5 +++++ daemon/daemon.go | 1 + 4 files changed, 15 insertions(+) diff --git a/daemon/config_solaris.go b/daemon/config_solaris.go index d20fc07b91..e59d0514df 100644 --- a/daemon/config_solaris.go +++ b/daemon/config_solaris.go @@ -38,6 +38,10 @@ func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) strin config.attachExperimentalFlags(cmd, usageFn) } +// GetExecRoot returns the user configured Exec-root +func (config *Config) GetExecRoot() string { + return config.ExecRoot +} func (config *Config) isSwarmCompatible() error { return nil } diff --git a/daemon/config_unix.go b/daemon/config_unix.go index d80a2c07c0..526ec3bd3c 100644 --- a/daemon/config_unix.go +++ b/daemon/config_unix.go @@ -124,6 +124,11 @@ func (config *Config) GetAllRuntimes() map[string]types.Runtime { return rts } +// GetExecRoot returns the user configured Exec-root +func (config *Config) GetExecRoot() string { + return config.ExecRoot +} + func (config *Config) isSwarmCompatible() error { if config.ClusterStore != "" || config.ClusterAdvertise != "" { return fmt.Errorf("--cluster-store and --cluster-advertise daemon configurations are incompatible with swarm mode") diff --git a/daemon/config_windows.go b/daemon/config_windows.go index 2844b983ce..061f7e737c 100644 --- a/daemon/config_windows.go +++ b/daemon/config_windows.go @@ -58,6 +58,11 @@ func (config *Config) GetAllRuntimes() map[string]types.Runtime { return map[string]types.Runtime{} } +// GetExecRoot returns the user configured Exec-root +func (config *Config) GetExecRoot() string { + return "" +} + func (config *Config) isSwarmCompatible() error { return nil } diff --git a/daemon/daemon.go b/daemon/daemon.go index 5408b96736..fc00546769 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -1041,6 +1041,7 @@ func (daemon *Daemon) networkOptions(dconfig *Config, activeSandboxes map[string } options = append(options, nwconfig.OptionDataDir(dconfig.Root)) + options = append(options, nwconfig.OptionExecRoot(dconfig.GetExecRoot())) dd := runconfig.DefaultDaemonNetworkMode() dn := runconfig.DefaultDaemonNetworkMode().NetworkName()