From 8bafc9771ef4b2d64ffdda89a2bf40f345d2eb0c Mon Sep 17 00:00:00 2001 From: Laurent Bernaille Date: Mon, 17 Dec 2018 13:46:50 +0100 Subject: [PATCH] [kube-proxy/ipvs] Do not try to delete RS already in termination list --- pkg/proxy/ipvs/proxier.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 66883e18dc3..3ea8ec04ed3 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1643,6 +1643,10 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre // Applying graceful termination to all real servers for _, rs := range rsList { uniqueRS := GetUniqueRSName(svc, rs) + // If RS is already in the graceful termination list, no need to add it again + if proxier.gracefuldeleteManager.InTerminationList(uniqueRS) { + continue + } klog.V(5).Infof("Using graceful delete to delete: %v", uniqueRS) if err := proxier.gracefuldeleteManager.GracefulDeleteRS(svc, rs); err != nil { klog.Errorf("Failed to delete destination: %v, error: %v", uniqueRS, err)