From 97c4edaa4f28f914db45766330b6db8953720588 Mon Sep 17 00:00:00 2001 From: louisssgong Date: Sat, 3 Aug 2019 17:44:12 +0800 Subject: [PATCH] Fix a bug in the IPVS proxier where virtual servers are not cleaned up even though the corresponding Service object was deleted. --- pkg/proxy/ipvs/proxier.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index ba215ca18f7..99df82d7321 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1770,25 +1770,6 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre continue } if _, ok := activeServices[cs]; !ok { - rsList, _ := proxier.ipvs.GetRealServers(svc) - - // If we still have real servers graceful termination is not done - if len(rsList) > 0 { - continue - } - - // 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) - } - } klog.V(4).Infof("Delete service %s", svc.String()) if err := proxier.ipvs.DeleteVirtualServer(svc); err != nil { klog.Errorf("Failed to delete service %s, error: %v", svc.String(), err)