Skip to content

Commit 28f10ff

Browse files
andrewsykimmurali-reddy
authored andcommitted
add local endpoints check if annotation kube-router.io/service.local is set (#388)
1 parent 1fcf5db commit 28f10ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/controllers/network_routes_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ func (nrc *NetworkRoutingController) getVIPsForService(svc *v1core.Service, only
486486

487487
nodeHasEndpoints := true
488488
if onlyActiveEndpoints {
489-
if svc.Spec.ExternalTrafficPolicy == v1core.ServiceExternalTrafficPolicyTypeLocal {
489+
_, isLocal := svc.Annotations[svcLocalAnnotation]
490+
if isLocal || svc.Spec.ExternalTrafficPolicy == v1core.ServiceExternalTrafficPolicyTypeLocal {
490491
nodeHasEndpoints, err = nrc.nodeHasEndpointsForService(svc)
491492
if err != nil {
492493
return nil, nil, err

0 commit comments

Comments
 (0)