From 8630e46336ff7de6cc62768be7469d2e7f89b193 Mon Sep 17 00:00:00 2001 From: mfanjie Date: Thu, 16 Jun 2016 09:41:28 +0800 Subject: [PATCH] only reachable endpoint should be treated as healthy --- federation/pkg/federation-controller/service/dns.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/federation/pkg/federation-controller/service/dns.go b/federation/pkg/federation-controller/service/dns.go index 03051e55353..496acfb8e48 100644 --- a/federation/pkg/federation-controller/service/dns.go +++ b/federation/pkg/federation-controller/service/dns.go @@ -44,6 +44,10 @@ func (s *ServiceController) getHealthyEndpoints(clusterName string, cachedServic return nil, nil, nil, err } for _, ingress := range lbStatus.Ingress { + readyEndpoints, ok := cachedService.endpointMap[lbClusterName] + if !ok || readyEndpoints == 0 { + continue + } var address string // We should get either an IP address or a hostname - use whichever one we get if ingress.IP != "" {