Fix "invalid port in upstream" on nginx controller

This commit is contained in:
Giancarlo Rubio 2016-12-14 17:42:34 +01:00
parent 0af8cccc7f
commit bda6646905
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) {
pc, err := newProcessCollector(true, exeMatcher{"nginx", args})
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)
if err != nil {

View file

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