From 17e2c7d5351a93bc2a68063e0a6c27c8c73c3430 Mon Sep 17 00:00:00 2001 From: Lars Ekman Date: Sun, 19 Feb 2023 17:54:00 +0100 Subject: [PATCH] Move variable closer to it's use --- pkg/proxy/ipvs/proxier.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index e9d073d09f8..0ce9a8609ff 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1024,9 +1024,7 @@ func (proxier *Proxier) syncProxyRules() { // activeIPVSServices represents IPVS service successfully created in this round of sync activeIPVSServices := sets.New[string]() - // currentIPVSServices represent IPVS services listed from the system - currentIPVSServices := make(map[string]*utilipvs.VirtualServer) - // activeBindAddrs represents ip address successfully bind to defaultDummyDevice in this round of sync + // activeBindAddrs Represents addresses we want on the defaultDummyDevice after this round of sync activeBindAddrs := sets.New[string]() bindedAddresses, err := proxier.netlinkHandle.GetLocalAddresses(defaultDummyDevice) @@ -1552,7 +1550,9 @@ func (proxier *Proxier) syncProxyRules() { } } - // Clean up legacy IPVS services and unbind addresses + // currentIPVSServices represent IPVS services listed from the system + // (including any we have created in this sync) + currentIPVSServices := make(map[string]*utilipvs.VirtualServer) appliedSvcs, err := proxier.ipvs.GetVirtualServers() if err == nil { for _, appliedSvc := range appliedSvcs {