use klog.InfoS instead of klog.V(0).InfoS

This commit is contained in:
JunYang
2022-08-05 09:44:34 +08:00
parent 26842bb0c8
commit 2db4dea565
6 changed files with 19 additions and 19 deletions

View File

@@ -814,7 +814,7 @@ func detectNodeIP(client clientset.Interface, hostname, bindAddress string) net.
nodeIP = utilnode.GetNodeIP(client, hostname)
}
if nodeIP == nil {
klog.V(0).InfoS("Can't determine this node's IP, assuming 127.0.0.1; if this is incorrect, please set the --bind-address flag")
klog.InfoS("Can't determine this node's IP, assuming 127.0.0.1; if this is incorrect, please set the --bind-address flag")
nodeIP = netutils.ParseIPSloppy("127.0.0.1")
}
return nodeIP

View File

@@ -170,22 +170,22 @@ func newProxyServer(
for _, perFamilyIpt := range ipt {
if !perFamilyIpt.Present() {
klog.V(0).InfoS("kube-proxy running in single-stack mode, this ipFamily is not supported", "ipFamily", perFamilyIpt.Protocol())
klog.InfoS("kube-proxy running in single-stack mode, this ipFamily is not supported", "ipFamily", perFamilyIpt.Protocol())
dualStack = false
}
}
}
if proxyMode == proxyconfigapi.ProxyModeIPTables {
klog.V(0).InfoS("Using iptables Proxier")
klog.InfoS("Using iptables Proxier")
if config.IPTables.MasqueradeBit == nil {
// MasqueradeBit must be specified or defaulted.
return nil, fmt.Errorf("unable to read IPTables MasqueradeBit from config")
}
if dualStack {
klog.V(0).InfoS("kube-proxy running in dual-stack mode", "ipFamily", iptInterface.Protocol())
klog.V(0).InfoS("Creating dualStackProxier for iptables")
klog.InfoS("kube-proxy running in dual-stack mode", "ipFamily", iptInterface.Protocol())
klog.InfoS("Creating dualStackProxier for iptables")
// Always ordered to match []ipt
var localDetectors [2]proxyutiliptables.LocalTrafficDetector
localDetectors, err = getDualStackLocalDetectorTuple(detectLocalMode, config, ipt, nodeInfo)
@@ -247,9 +247,9 @@ func newProxyServer(
}
ipvsInterface = utilipvs.New()
klog.V(0).InfoS("Using ipvs Proxier")
klog.InfoS("Using ipvs Proxier")
if dualStack {
klog.V(0).InfoS("Creating dualStackProxier for ipvs")
klog.InfoS("Creating dualStackProxier for ipvs")
nodeIPs := nodeIPTuple(config.BindAddress)
@@ -321,8 +321,8 @@ func newProxyServer(
}
proxymetrics.RegisterMetrics()
} else {
klog.V(0).InfoS("Using userspace Proxier")
klog.V(0).InfoS("The userspace proxier is now deprecated and will be removed in a future release, please use 'iptables' or 'ipvs' instead")
klog.InfoS("Using userspace Proxier")
klog.InfoS("The userspace proxier is now deprecated and will be removed in a future release, please use 'iptables' or 'ipvs' instead")
// TODO this has side effects that should only happen when Run() is invoked.
proxier, err = userspace.NewProxier(
@@ -453,7 +453,7 @@ func getLocalDetector(mode proxyconfigapi.LocalMode, config *proxyconfigapi.Kube
}
return proxyutiliptables.NewDetectLocalByInterfaceNamePrefix(config.DetectLocal.InterfaceNamePrefix)
}
klog.V(0).InfoS("Defaulting to no-op detect-local", "detect-local-mode", string(mode))
klog.InfoS("Defaulting to no-op detect-local", "detect-local-mode", string(mode))
return proxyutiliptables.NewNoOpLocalDetector(), nil
}

View File

@@ -105,9 +105,9 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, master string
proxyMode := getProxyMode(config.Mode, winkernel.WindowsKernelCompatTester{})
dualStackMode := getDualStackMode(config.Winkernel.NetworkName, winkernel.DualStackCompatTester{})
if proxyMode == proxyconfigapi.ProxyModeKernelspace {
klog.V(0).InfoS("Using Kernelspace Proxier.")
klog.InfoS("Using Kernelspace Proxier.")
if dualStackMode {
klog.V(0).InfoS("Creating dualStackProxier for Windows kernel.")
klog.InfoS("Creating dualStackProxier for Windows kernel.")
proxier, err = winkernel.NewDualStackProxier(
config.IPTables.SyncPeriod.Duration,
@@ -146,8 +146,8 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, master string
winkernel.RegisterMetrics()
} else {
klog.V(0).InfoS("Using userspace Proxier.")
klog.V(0).InfoS("The userspace proxier is now deprecated and will be removed in a future release, please use 'kernelspace' instead")
klog.InfoS("Using userspace Proxier.")
klog.InfoS("The userspace proxier is now deprecated and will be removed in a future release, please use 'kernelspace' instead")
execer := exec.New()
var netshInterface utilnetsh.Interface
netshInterface = utilnetsh.New(execer)