Skip to content

Commit

Permalink
Merge pull request #1078 from ghostcloud-cn/fixcmupdate
Browse files Browse the repository at this point in the history
fix the same udp port and tcp port, update nginx.conf error
  • Loading branch information
aledbf authored Aug 7, 2017
2 parents 9b80d3b + fa2c422 commit 413b4ad
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/pkg/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ func newIngressController(config *Configuration) *GenericController {
} else {
glog.Warning("Update of ingress status is disabled (flag --update-status=false was specified)")
}

ic.annotations = newAnnotationExtractor(ic)

ic.cfg.Backend.SetListers(ingress.StoreLister{
Expand Down Expand Up @@ -506,17 +505,21 @@ func (ic *GenericController) getStreamServices(configmapName string, proto api.P
glog.V(3).Infof("searching service %v/%v endpoints using the name '%v'", svcNs, svcName, svcPort)
for _, sp := range svc.Spec.Ports {
if sp.Name == svcPort {
endps = ic.getEndpoints(svc, &sp, proto, &healthcheck.Upstream{})
break
if sp.Protocol == proto {
endps = ic.getEndpoints(svc, &sp, proto, &healthcheck.Upstream{})
break
}
}
}
} else {
// we need to use the TargetPort (where the endpoints are running)
glog.V(3).Infof("searching service %v/%v endpoints using the target port '%v'", svcNs, svcName, targetPort)
for _, sp := range svc.Spec.Ports {
if sp.Port == int32(targetPort) {
endps = ic.getEndpoints(svc, &sp, proto, &healthcheck.Upstream{})
break
if sp.Protocol == proto {
endps = ic.getEndpoints(svc, &sp, proto, &healthcheck.Upstream{})
break
}
}
}
}
Expand Down

0 comments on commit 413b4ad

Please sign in to comment.