Skip to content

Commit c9bc18e

Browse files
author
Murali Reddy
committed
Skip head less services, when advertising cluster IP to external routers
Fixes #20
1 parent 1f2ad9e commit c9bc18e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/controllers/network_routes_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ func (nrc *NetworkRoutingController) Run(stopCh <-chan struct{}, wg *sync.WaitGr
9696
glog.Infof("Advertising cluster ips")
9797
for _, svc := range watchers.ServiceWatcher.List() {
9898
if svc.Spec.Type == "ClusterIP" || svc.Spec.Type == "NodePort" {
99+
100+
// skip headless services
101+
if svc.Spec.ClusterIP == "None" || svc.Spec.ClusterIP == "" {
102+
continue
103+
}
104+
99105
glog.Infof("found a service of cluster ip type")
100106
nrc.AdvertiseClusterIp(svc.Spec.ClusterIP)
101107
}

0 commit comments

Comments
 (0)