Merge pull request #58 from gianrubio/branch/invalid-port

Fix "invalid port in upstream" on nginx controller
This commit is contained in:
Manuel Alejandro de Brito Fontes 2016-12-21 13:44:53 -03:00 committed by GitHub
commit 825a4a60ad
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ func (em exeMatcher) MatchAndName(nacl common.NameAndCmdline) (bool, string) {
func (n *NGINXController) setupMonitor(args []string) { func (n *NGINXController) setupMonitor(args []string) {
pc, err := newProcessCollector(true, exeMatcher{"nginx", args}) pc, err := newProcessCollector(true, exeMatcher{"nginx", args})
if err != nil { if err != nil {
glog.Fatalf("unexpedted error registering nginx collector: %v", err) glog.Fatalf("unexpected error registering nginx collector: %v", err)
} }
err = prometheus.Register(pc) err = prometheus.Register(pc)
if err != nil { if err != nil {

View file

@ -982,7 +982,7 @@ func (ic *GenericController) getEndpoints(
} }
// check for invalid port value // check for invalid port value
if targetPort == -1 { if targetPort <=0 {
continue continue
} }