moby--moby/libnetwork/portallocator
Sebastiaan van Stijn c7b1e5ba38
portallocator: log instead of discard port-range failures
Both getDynamicPortRange() and sanitizePortRange() could produce
and error, and the error message was currently discarded, silently
falling back to using the default port range.

This patch:

- Moves the fallback message from getDynamicPortRange() to getDefaultPortRange(),
  which is where the actual fallback occurs.
- Logs the fallback message and the error that causes the fallback.

The message/error is currently printed at the INFO level, but could be raised
to a WARN, depending on what kind of situations can cause the error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:59 +02:00
..
portallocator.go portallocator: log instead of discard port-range failures 2021-06-10 10:52:59 +02:00
portallocator_freebsd.go portallocator: log instead of discard port-range failures 2021-06-10 10:52:59 +02:00
portallocator_linux.go portallocator: log instead of discard port-range failures 2021-06-10 10:52:59 +02:00
portallocator_test.go
portallocator_unix.go
portallocator_windows.go