1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
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 Fixup libnetwork lint errors 2021-06-01 23:48:32 +00:00
portallocator_unix.go portallocator: use const for default port-ranges, instead of init() 2021-06-10 10:52:49 +02:00
portallocator_windows.go portallocator: use const for default port-ranges, instead of init() 2021-06-10 10:52:49 +02:00