зеркало из https://github.com/microsoft/docker.git
Check for conflicting daemon config options in NewDaemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
This commit is contained in:
Родитель
ca11b77471
Коммит
1eba59eb24
|
@ -677,6 +677,13 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
|
|||
// FIXME: GetDefaultNetwork Mtu doesn't need to be public anymore
|
||||
config.Mtu = GetDefaultNetworkMtu()
|
||||
}
|
||||
// Check for mutually incompatible config options
|
||||
if config.BridgeIface != "" && config.BridgeIP != "" {
|
||||
return nil, fmt.Errorf("You specified -b & --bip, mutually exclusive options. Please specify only one.")
|
||||
}
|
||||
if !config.EnableIptables && !config.InterContainerCommunication {
|
||||
return nil, fmt.Errorf("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.")
|
||||
}
|
||||
// FIXME: DisableNetworkBidge doesn't need to be public anymore
|
||||
config.DisableNetwork = config.BridgeIface == DisableNetworkBridge
|
||||
|
||||
|
|
|
@ -30,15 +30,6 @@ func mainDaemon() {
|
|||
flag.Usage()
|
||||
return
|
||||
}
|
||||
|
||||
// FIXME: validate daemon.Config values in a method of daemon.Config
|
||||
if daemonCfg.BridgeIface != "" && daemonCfg.BridgeIP != "" {
|
||||
log.Fatal("You specified -b & --bip, mutually exclusive options. Please specify only one.")
|
||||
}
|
||||
|
||||
if !daemonCfg.EnableIptables && !daemonCfg.InterContainerCommunication {
|
||||
log.Fatal("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.")
|
||||
}
|
||||
eng := engine.New()
|
||||
signal.Trap(eng.Shutdown)
|
||||
// Load builtins
|
||||
|
|
Загрузка…
Ссылка в новой задаче