mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #114360 from dengyufeng2206/120802pull
Reduce redundant conversions
This commit is contained in:
commit
53906cbe89
@ -1574,14 +1574,14 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
proxier.iptablesData.Write(proxier.filterChains.Bytes())
|
proxier.iptablesData.Write(proxier.filterChains.Bytes())
|
||||||
proxier.iptablesData.Write(proxier.filterRules.Bytes())
|
proxier.iptablesData.Write(proxier.filterRules.Bytes())
|
||||||
|
|
||||||
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)
|
err = proxier.iptables.RestoreAll(proxier.iptablesData.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if pErr, ok := err.(utiliptables.ParseError); ok {
|
if pErr, ok := err.(utiliptables.ParseError); ok {
|
||||||
lines := utiliptables.ExtractLines(proxier.iptablesData.Bytes(), pErr.Line(), 3)
|
lines := utiliptables.ExtractLines(proxier.iptablesData.Bytes(), pErr.Line(), 3)
|
||||||
klog.ErrorS(pErr, "Failed to execute iptables-restore", "rules", lines)
|
klog.ErrorS(pErr, "Failed to execute iptables-restore", "rules", lines)
|
||||||
} else {
|
} else {
|
||||||
klog.ErrorS(err, "Failed to execute iptables-restore", "rules", string(proxier.iptablesData.Bytes()))
|
klog.ErrorS(err, "Failed to execute iptables-restore", "rules", proxier.iptablesData.Bytes())
|
||||||
}
|
}
|
||||||
metrics.IptablesRestoreFailuresTotal.Inc()
|
metrics.IptablesRestoreFailuresTotal.Inc()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user