Skip to content

Commit

Permalink
Fix svcPort support (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
lavanya-f5 authored Sep 23, 2022
1 parent f5f30bc commit 853845a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/resourceConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ func (ctlr *Controller) prepareRSConfigFromVirtualServer(
continue
}
framedPools[poolName] = struct{}{}
targetPort := intstr.IntOrString{IntVal: pl.ServicePort}
targetPort := ctlr.fetchTargetPort(vs.Namespace, pl.Service, pl.ServicePort)

if (intstr.IntOrString{}) == targetPort {
targetPort = ctlr.fetchTargetPort(vs.Namespace, pl.Service, pl.ServicePort)
targetPort = intstr.IntOrString{IntVal: pl.ServicePort}
}
svcNamespace := vs.Namespace
if pl.ServiceNamespace != "" {
Expand Down
8 changes: 8 additions & 0 deletions pkg/controller/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,10 @@ func (ctlr *Controller) updatePoolMembersForNodePort(
ctlr.getEndpointsForNodePort(svcPort.NodePort, pool.NodeMemberLabel)
}
}
//check if endpoints are found
if rsCfg.Pools[index].Members == nil {
log.Errorf("[CORE]Endpoints could not be fetched for service %v with targetPort %v", svcName, pool.ServicePort.IntVal)
}
}
}

Expand Down Expand Up @@ -1545,6 +1549,10 @@ func (ctlr *Controller) updatePoolMembersForCluster(
rsCfg.MetaData.Active = true
rsCfg.Pools[index].Members = mems
}
//check if endpoints are found
if rsCfg.Pools[index].Members == nil {
log.Errorf("[CORE]Endpoints could not be fetched for service %v with targetPort %v", svcName, pool.ServicePort.IntVal)
}
}
}

Expand Down

0 comments on commit 853845a

Please sign in to comment.