Skip to content

Commit 55b4666

Browse files
Merge pull request #19416 from pravisankar/fix-router-endpoint-id
Bug 1567532 - Unidle handling in router should ignore headless services
2 parents 1a712f2 + e339d73 commit 55b4666

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/router/template/plugin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"k8s.io/apimachinery/pkg/util/sets"
1616
"k8s.io/apimachinery/pkg/watch"
1717
kapi "k8s.io/kubernetes/pkg/apis/core"
18+
kapihelper "k8s.io/kubernetes/pkg/apis/core/helper"
1819

1920
routeapi "github.com/openshift/origin/pkg/route/apis/route"
2021
unidlingapi "github.com/openshift/origin/pkg/unidling/api"
@@ -239,7 +240,7 @@ func createRouterEndpoints(endpoints *kapi.Endpoints, excludeUDP bool, lookupSvc
239240
return []Endpoint{}
240241
}
241242

242-
if service.Spec.ClusterIP == "" {
243+
if !kapihelper.IsServiceIPSet(service) {
243244
utilruntime.HandleError(fmt.Errorf("headless service %s/%s was marked as idled, but cannot setup unidling without a cluster IP", endpoints.Namespace, endpoints.Name))
244245
return []Endpoint{}
245246
}

0 commit comments

Comments
 (0)