Skip to content

Commit

Permalink
fix ports (#9149)
Browse files Browse the repository at this point in the history
  • Loading branch information
tombokombo authored Oct 13, 2022
1 parent e53d19c commit 499dbf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/ingress/controller/endpointslices.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func getEndpointsFromSlices(s *corev1.Service, port *corev1.ServicePort, proto c
// loop over all endpointSlices generated for service
for _, eps := range epss {
var ports []int32
if len(eps.Ports) == 0 {
// When ports is empty, it indicates that there are no defined ports, using svc targePort <- this could be wrong
if len(eps.Ports) == 0 && port.TargetPort.Type == intstr.Int {
// When ports is empty, it indicates that there are no defined ports, using svc targePort if it's a number
klog.V(3).Infof("No ports found on endpointSlice, using service TargetPort %v for Service %q", port.String(), svcKey)
ports = append(ports, port.TargetPort.IntVal)
} else {
Expand Down

0 comments on commit 499dbf5

Please sign in to comment.