зеркало из https://github.com/microsoft/docker.git
Merge pull request #11545 from cpuguy83/remove_allocator_warning
Don't warn when ip_local_port_range not found
This commit is contained in:
Коммит
ccd4181d10
|
@ -79,10 +79,11 @@ func NewErrPortAlreadyAllocated(ip string, port int) ErrPortAlreadyAllocated {
|
|||
|
||||
func init() {
|
||||
const portRangeKernelParam = "/proc/sys/net/ipv4/ip_local_port_range"
|
||||
portRangeFallback := fmt.Sprintf("using fallback port range %d-%d", beginPortRange, endPortRange)
|
||||
|
||||
file, err := os.Open(portRangeKernelParam)
|
||||
if err != nil {
|
||||
log.Warnf("Failed to read %s kernel parameter: %v", portRangeKernelParam, err)
|
||||
log.Warnf("port allocator - %s due to error: %v", portRangeFallback, err)
|
||||
return
|
||||
}
|
||||
var start, end int
|
||||
|
@ -91,7 +92,7 @@ func init() {
|
|||
if err == nil {
|
||||
err = fmt.Errorf("unexpected count of parsed numbers (%d)", n)
|
||||
}
|
||||
log.Errorf("Failed to parse port range from %s: %v", portRangeKernelParam, err)
|
||||
log.Errorf("port allocator - failed to parse system ephemeral port range from %s - %s: %v", portRangeKernelParam, portRangeFallback, err)
|
||||
return
|
||||
}
|
||||
beginPortRange = start
|
||||
|
|
Загрузка…
Ссылка в новой задаче