Merge pull request #525 from aledbf/fix-negative-maxopenfiles

Avoid negative values configuring the max number of open files
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-03-30 10:40:52 -03:00 committed by GitHub
commit 0bdf253d5e

View file

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