Avoid negative values configuring the max number of open files

This commit is contained in:
Manuel de Brito Fontes 2017-03-30 10:10:47 -03:00
parent 752672866b
commit cf82f694de

View file

@ -370,6 +370,10 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) ([]byte, er
wp = 1
}
maxOpenFiles := (sysctlFSFileMax() / wp) - 1024
if maxOpenFiles < 0 {
// this means the value of RLIMIT_NOFILE is too low.
maxOpenFiles = 1024
}
setHeaders := map[string]string{}
if cfg.ProxySetHeaders != "" {