diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 79802d635f..cc543e1636 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -1609,7 +1609,7 @@ func (proxier *Proxier) syncProxyRules() { // Finish housekeeping. // TODO: these could be made more consistent. - for _, svcIP := range staleServices.List() { + for _, svcIP := range staleServices.UnsortedList() { if err := utilproxy.ClearUDPConntrackForIP(proxier.exec, svcIP); err != nil { glog.Errorf("Failed to delete stale service IP %s connections, error: %v", svcIP, err) } diff --git a/pkg/proxy/iptables/proxier_test.go b/pkg/proxy/iptables/proxier_test.go index 2e92934724..4140b08878 100644 --- a/pkg/proxy/iptables/proxier_test.go +++ b/pkg/proxy/iptables/proxier_test.go @@ -1050,7 +1050,7 @@ func TestBuildServiceMapAddRemove(t *testing.T) { // the not-deleted service, because one of it's ServicePorts was deleted. expectedStaleUDPServices := []string{"172.16.55.10", "172.16.55.4", "172.16.55.11", "172.16.55.12"} if len(result.staleServices) != len(expectedStaleUDPServices) { - t.Errorf("expected stale UDP services length %d, got %v", len(expectedStaleUDPServices), result.staleServices.List()) + t.Errorf("expected stale UDP services length %d, got %v", len(expectedStaleUDPServices), result.staleServices.UnsortedList()) } for _, ip := range expectedStaleUDPServices { if !result.staleServices.Has(ip) { @@ -1166,7 +1166,7 @@ func TestBuildServiceMapServiceUpdate(t *testing.T) { t.Errorf("expected healthcheck ports length 1, got %v", result.hcServices) } if len(result.staleServices) != 0 { - t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.List()) + t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.UnsortedList()) } // No change; make sure the service map stays the same and there are @@ -1180,7 +1180,7 @@ func TestBuildServiceMapServiceUpdate(t *testing.T) { t.Errorf("expected healthcheck ports length 1, got %v", result.hcServices) } if len(result.staleServices) != 0 { - t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.List()) + t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.UnsortedList()) } // And back to ClusterIP diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 8066f61003..97b5098c9b 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -673,7 +673,7 @@ func CanUseIPVSProxier() (bool, error) { loadModules := sets.NewString() wantModules.Insert(ipvsModules...) loadModules.Insert(mods...) - modules := wantModules.Difference(loadModules).List() + modules := wantModules.Difference(loadModules).UnsortedList() if len(modules) != 0 { return false, fmt.Errorf("IPVS proxier will not be used because the following required kernel modules are not loaded: %v", modules) } @@ -1254,7 +1254,7 @@ func (proxier *Proxier) syncProxyRules() { // Finish housekeeping. // TODO: these could be made more consistent. - for _, svcIP := range staleServices.List() { + for _, svcIP := range staleServices.UnsortedList() { if err := utilproxy.ClearUDPConntrackForIP(proxier.exec, svcIP); err != nil { glog.Errorf("Failed to delete stale service IP %s connections, error: %v", svcIP, err) } @@ -1339,7 +1339,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode if !curEndpoints.Equal(newEndpoints) { // Create new endpoints - for _, ep := range newEndpoints.Difference(curEndpoints).List() { + for _, ep := range newEndpoints.Difference(curEndpoints).UnsortedList() { ip, port, err := net.SplitHostPort(ep) if err != nil { glog.Errorf("Failed to parse endpoint: %v, error: %v", ep, err) @@ -1363,7 +1363,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode } } // Delete old endpoints - for _, ep := range curEndpoints.Difference(newEndpoints).List() { + for _, ep := range curEndpoints.Difference(newEndpoints).UnsortedList() { ip, port, err := net.SplitHostPort(ep) if err != nil { glog.Errorf("Failed to parse endpoint: %v, error: %v", ep, err) diff --git a/pkg/proxy/userspace/proxier.go b/pkg/proxy/userspace/proxier.go index f4e8d7f03a..8c4f622e11 100644 --- a/pkg/proxy/userspace/proxier.go +++ b/pkg/proxy/userspace/proxier.go @@ -503,7 +503,7 @@ func (proxier *Proxier) unmergeService(service *api.Service, existingPorts sets. } proxier.loadBalancer.DeleteService(serviceName) } - for _, svcIP := range staleUDPServices.List() { + for _, svcIP := range staleUDPServices.UnsortedList() { if err := utilproxy.ClearUDPConntrackForIP(proxier.exec, svcIP); err != nil { glog.Errorf("Failed to delete stale service IP %s connections, error: %v", svcIP, err) } diff --git a/pkg/proxy/winkernel/proxier.go b/pkg/proxy/winkernel/proxier.go index 4c8f818df0..d570760955 100644 --- a/pkg/proxy/winkernel/proxier.go +++ b/pkg/proxy/winkernel/proxier.go @@ -1130,7 +1130,7 @@ func (proxier *Proxier) syncProxyRules() { // Finish housekeeping. // TODO: these could be made more consistent. - for _, svcIP := range staleServices.List() { + for _, svcIP := range staleServices.UnsortedList() { // TODO : Check if this is required to cleanup stale services here glog.V(5).Infof("Pending delete stale service IP %s connections", svcIP) }