1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Setting iptables=false should propagate to ip-masq=false

Signed-off-by: Jessica Frazelle <jess@docker.com>
This commit is contained in:
Jessica Frazelle 2014-10-16 11:39:22 -07:00 committed by Tibor Vass
parent e134f1f74a
commit ada9ac7b13
2 changed files with 11 additions and 1 deletions

View file

@ -731,7 +731,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
return nil, fmt.Errorf("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.")
}
if !config.EnableIptables && config.EnableIpMasq {
return nil, fmt.Errorf("You specified --iptables=false with --ipmasq=true. IP masquerading uses iptables to function. Please set --ipmasq to false or --iptables to true.")
config.EnableIpMasq = false
}
config.DisableNetwork = config.BridgeIface == disableNetworkBridge

View file

@ -82,3 +82,13 @@ func TestDaemonRestartWithVolumesRefs(t *testing.T) {
logDone("daemon - volume refs are restored")
}
func TestDaemonStartIptablesFalse(t *testing.T) {
d := NewDaemon(t)
if err := d.Start("--iptables=false"); err != nil {
t.Fatalf("we should have been able to start the daemon with passing iptables=false: %v", err)
}
d.Stop()
logDone("daemon - started daemon with iptables=false")
}