Skip to content

Commit ec598d1

Browse files
committed
[kube-proxy/ipvs] Gofmt
1 parent 0f9d30d commit ec598d1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/proxy/ipvs/proxier.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ func (proxier *Proxier) syncProxyRules() {
11961196
if err != nil {
11971197
klog.Errorf("Failed to get bind address, err: %v", err)
11981198
}
1199-
legacyBindAddrs := proxier.getLegacyBindAddr(activeBindAddrs,currentBindAddrs)
1199+
legacyBindAddrs := proxier.getLegacyBindAddr(activeBindAddrs, currentBindAddrs)
12001200

12011201
// Clean up legacy IPVS services and unbind addresses
12021202
appliedSvcs, err := proxier.ipvs.GetVirtualServers()
@@ -1646,14 +1646,14 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre
16461646
if err := proxier.ipvs.DeleteVirtualServer(svc); err != nil {
16471647
klog.Errorf("Failed to delete service %s, error: %v", svc.String(), err)
16481648
}
1649-
addr:=svc.Address.String()
1649+
addr := svc.Address.String()
16501650
if _, ok := legacyBindAddrs[addr]; ok {
16511651
klog.V(4).Infof("Unbinding address %s", addr)
16521652
if err := proxier.netlinkHandle.UnbindAddress(addr, DefaultDummyDevice); err != nil {
16531653
klog.Errorf("Failed to unbind service addr %s from dummy interface %s: %v", addr, DefaultDummyDevice, err)
16541654
} else {
16551655
// In case we delete a multi-port service, avoid trying to unbind multiple times
1656-
delete(legacyBindAddrs,addr)
1656+
delete(legacyBindAddrs, addr)
16571657
}
16581658
}
16591659
}
@@ -1662,10 +1662,10 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre
16621662
}
16631663

16641664
func (proxier *Proxier) getLegacyBindAddr(activeBindAddrs map[string]bool, currentBindAddrs []string) map[string]bool {
1665-
legacyAddrs := make(map[string]bool)
1665+
legacyAddrs := make(map[string]bool)
16661666
for _, addr := range currentBindAddrs {
16671667
if _, ok := activeBindAddrs[addr]; !ok {
1668-
legacyAddrs[addr]=true
1668+
legacyAddrs[addr] = true
16691669
}
16701670
}
16711671
return legacyAddrs

pkg/proxy/ipvs/proxier_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,10 +2871,10 @@ func TestCleanLegacyService(t *testing.T) {
28712871
activeBindAddrs := map[string]bool{"1.1.1.1": true, "2.2.2.2": true, "3.3.3.3": true, "4.4.4.4": true}
28722872
currentBindAddrs := []string{"1.1.1.1", "2.2.2.2", "3.3.3.3", "4.4.4.4", "5.5.5.5", "6.6.6.6"}
28732873
for i := range currentBindAddrs {
2874-
fp.netlinkHandle.EnsureAddressBind(currentBindAddrs[i], DefaultDummyDevice)
2874+
fp.netlinkHandle.EnsureAddressBind(currentBindAddrs[i], DefaultDummyDevice)
28752875
}
28762876

2877-
fp.cleanLegacyService(activeServices, currentServices, map[string]bool{"5.5.5.5":true,"6.6.6.6":true})
2877+
fp.cleanLegacyService(activeServices, currentServices, map[string]bool{"5.5.5.5": true, "6.6.6.6": true})
28782878
// ipvs4 and ipvs5 should have been cleaned.
28792879
remainingVirtualServers, _ := fp.ipvs.GetVirtualServers()
28802880
if len(remainingVirtualServers) != 4 {

0 commit comments

Comments
 (0)