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>
... | ... |
@@ -489,8 +489,8 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. |
489 | 489 |
return warnings, fmt.Errorf("Invalid value %d, range for oom score adj is [-1000, 1000]", hostConfig.OomScoreAdj) |
490 | 490 |
} |
491 | 491 |
|
492 |
- // ip-forwarding does not affect container with '--net=host' |
|
493 |
- if sysInfo.IPv4ForwardingDisabled && !hostConfig.NetworkMode.IsHost() { |
|
492 |
+ // ip-forwarding does not affect container with '--net=host' (or '--net=none') |
|
493 |
+ if sysInfo.IPv4ForwardingDisabled && !(hostConfig.NetworkMode.IsHost() || hostConfig.NetworkMode.IsNone()) { |
|
494 | 494 |
warnings = append(warnings, "IPv4 forwarding is disabled. Networking will not work.") |
495 | 495 |
logrus.Warnf("IPv4 forwarding is disabled. Networking will not work") |
496 | 496 |
} |