From 8b16d66b46e8ca30052f22fcdf32660ed9dc7d67 Mon Sep 17 00:00:00 2001 From: m1093782566 Date: Wed, 2 May 2018 17:02:07 +0800 Subject: [PATCH] add some comment message --- pkg/proxy/iptables/proxier.go | 4 +++- pkg/proxy/ipvs/proxier.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index de35c9f11fa..73b7b27d9de 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -962,7 +962,7 @@ func (proxier *Proxier) syncProxyRules() { // (because the socket might open but it would never work). addresses, err := utilproxy.GetNodeAddresses(proxier.nodePortAddresses, proxier.networkInterfacer) if err != nil { - glog.Errorf("Failed to get node ip address matching nodeport cidr") + glog.Errorf("Failed to get node ip address matching nodeport cidr: %v", err) continue } @@ -976,6 +976,7 @@ func (proxier *Proxier) syncProxyRules() { Protocol: protocol, } lps = append(lps, lp) + // If we encounter a zero CIDR, then there is no point in processing the rest of the addresses. break } lp := utilproxy.LocalPort{ @@ -987,6 +988,7 @@ func (proxier *Proxier) syncProxyRules() { lps = append(lps, lp) } + // For ports on node IPs, open the actual port and hold it. for _, lp := range lps { if proxier.portsMap[lp] != nil { glog.V(4).Infof("Port %s was open before and is still needed", lp.String()) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index dbea191b190..1c067a24d4f 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -987,7 +987,7 @@ func (proxier *Proxier) syncProxyRules() { if svcInfo.NodePort != 0 { addresses, err := utilproxy.GetNodeAddresses(proxier.nodePortAddresses, proxier.networkInterfacer) if err != nil { - glog.Errorf("Failed to get node ip address matching nodeport cidr") + glog.Errorf("Failed to get node ip address matching nodeport cidr: %v", err) continue } @@ -1001,6 +1001,7 @@ func (proxier *Proxier) syncProxyRules() { Protocol: protocol, } lps = append(lps, lp) + // If we encounter a zero CIDR, then there is no point in processing the rest of the addresses. break } lp := utilproxy.LocalPort{ @@ -1012,6 +1013,7 @@ func (proxier *Proxier) syncProxyRules() { lps = append(lps, lp) } + // For ports on node IPs, open the actual port and hold it. for _, lp := range lps { if proxier.portsMap[lp] != nil { glog.V(4).Infof("Port %s was open before and is still needed", lp.String())