mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Suppress "IPv4 forwarding" warning for --net=none
There's no need to warn that "ip-forwarding" is disabled if a container doesn't use networking. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
52debcd58a
commit
27f34593ea
1 changed files with 2 additions and 2 deletions
|
@ -489,8 +489,8 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
|
||||||
return warnings, fmt.Errorf("Invalid value %d, range for oom score adj is [-1000, 1000]", hostConfig.OomScoreAdj)
|
return warnings, fmt.Errorf("Invalid value %d, range for oom score adj is [-1000, 1000]", hostConfig.OomScoreAdj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ip-forwarding does not affect container with '--net=host'
|
// ip-forwarding does not affect container with '--net=host' (or '--net=none')
|
||||||
if sysInfo.IPv4ForwardingDisabled && !hostConfig.NetworkMode.IsHost() {
|
if sysInfo.IPv4ForwardingDisabled && !(hostConfig.NetworkMode.IsHost() || hostConfig.NetworkMode.IsNone()) {
|
||||||
warnings = append(warnings, "IPv4 forwarding is disabled. Networking will not work.")
|
warnings = append(warnings, "IPv4 forwarding is disabled. Networking will not work.")
|
||||||
logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")
|
logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue