From 572e3bebcc0eb1a43183239dfafccdaa04447f02 Mon Sep 17 00:00:00 2001 From: Minhan Xia Date: Mon, 13 Feb 2017 12:18:42 -0800 Subject: [PATCH] fix healthcheck update problem introduced by #41223 --- pkg/proxy/iptables/proxier.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 044b047eb4c..311ef58d04b 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -649,7 +649,17 @@ func (proxier *Proxier) OnEndpointsUpdate(allEndpoints []api.Endpoints) { staleConnections[endpointServicePair{endpoint: ep.ip, servicePortName: svcPort}] = true } } + } + // Update service health check + allSvcPorts := make(map[proxy.ServicePortName]bool) + for svcPort := range proxier.endpointsMap { + allSvcPorts[svcPort] = true + } + for svcPort := range newEndpointsMap { + allSvcPorts[svcPort] = true + } + for svcPort := range allSvcPorts { proxier.updateHealthCheckEntries(svcPort.NamespacedName, svcPortToInfoMap[svcPort]) }