From 580b557592ca7af0bd7e3583c613956e657f6b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=81=E6=B5=A9=2010284789?= Date: Thu, 27 May 2021 07:07:22 +0000 Subject: [PATCH] Log spelling formatting and a redundant conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刁浩 10284789 --- pkg/proxy/iptables/proxier.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index d186060396a..0e7fb1a73cb 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -273,13 +273,13 @@ func NewProxier(ipt utiliptables.Interface, // are connected to a Linux bridge (but not SDN bridges). Until most // plugins handle this, log when config is missing if val, err := sysctl.GetSysctl(sysctlBridgeCallIPTables); err == nil && val != 1 { - klog.InfoS("missing br-netfilter module or unset sysctl br-nf-call-iptables; proxy may not work as intended") + klog.InfoS("Missing br-netfilter module or unset sysctl br-nf-call-iptables; proxy may not work as intended") } // Generate the masquerade mark to use for SNAT rules. masqueradeValue := 1 << uint(masqueradeBit) masqueradeMark := fmt.Sprintf("%#08x", masqueradeValue) - klog.V(2).InfoS("using iptables mark for masquerade", "ipFamily", ipt.Protocol(), "mark", masqueradeMark) + klog.V(2).InfoS("Using iptables mark for masquerade", "ipFamily", ipt.Protocol(), "mark", masqueradeMark) endpointSlicesEnabled := utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying) @@ -294,7 +294,7 @@ func NewProxier(ipt utiliptables.Interface, nodePortAddresses = ipFamilyMap[ipFamily] // Log the IPs not matching the ipFamily if ips, ok := ipFamilyMap[utilproxy.OtherIPFamily(ipFamily)]; ok && len(ips) > 0 { - klog.InfoS("found node IPs of the wrong family", "ipFamily", ipFamily, "ips", strings.Join(ips, ",")) + klog.InfoS("Found node IPs of the wrong family", "ipFamily", ipFamily, "ips", strings.Join(ips, ",")) } proxier := &Proxier{ @@ -327,7 +327,7 @@ func NewProxier(ipt utiliptables.Interface, } burstSyncs := 2 - klog.V(2).InfoS("iptables sync params", "ipFamily", ipt.Protocol(), "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", burstSyncs) + klog.V(2).InfoS("Iptables sync params", "ipFamily", ipt.Protocol(), "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", burstSyncs) // We pass syncPeriod to ipt.Monitor, which will call us only if it needs to. // We need to pass *some* maxInterval to NewBoundedFrequencyRunner anyway though. // time.Hour is arbitrary. @@ -337,9 +337,9 @@ func NewProxier(ipt utiliptables.Interface, proxier.syncProxyRules, syncPeriod, wait.NeverStop) if ipt.HasRandomFully() { - klog.V(2).InfoS("iptables supports --random-fully", "ipFamily", ipt.Protocol()) + klog.V(2).InfoS("Iptables supports --random-fully", "ipFamily", ipt.Protocol()) } else { - klog.V(2).InfoS("iptables does not support --random-fully", "ipFamily", ipt.Protocol()) + klog.V(2).InfoS("Iptables does not support --random-fully", "ipFamily", ipt.Protocol()) } return proxier, nil @@ -829,7 +829,7 @@ func (proxier *Proxier) syncProxyRules() { start := time.Now() defer func() { metrics.SyncProxyRulesLatency.Observe(metrics.SinceInSeconds(start)) - klog.V(2).InfoS("syncProxyRules complete", "elapsed", time.Since(start)) + klog.V(2).InfoS("SyncProxyRules complete", "elapsed", time.Since(start)) }() // We assume that if this was called, we really want to sync them, @@ -1620,7 +1620,7 @@ func (proxier *Proxier) syncProxyRules() { numberNatIptablesRules := utilproxy.CountBytesLines(proxier.natRules.Bytes()) metrics.IptablesRulesTotal.WithLabelValues(string(utiliptables.TableNAT)).Set(float64(numberNatIptablesRules)) - klog.V(5).InfoS("Restoring iptables", "rules", string(proxier.iptablesData.Bytes())) + klog.V(5).InfoS("Restoring iptables", "rules", proxier.iptablesData.Bytes()) err = proxier.iptables.RestoreAll(proxier.iptablesData.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters) if err != nil { klog.ErrorS(err, "Failed to execute iptables-restore")