Move from glog to klog

- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
This commit is contained in:
Davanum Srinivas
2018-11-09 13:49:10 -05:00
parent 97baad34a7
commit 954996e231
1263 changed files with 10023 additions and 10076 deletions

View File

@@ -42,7 +42,7 @@ import (
utilnode "k8s.io/kubernetes/pkg/util/node"
"k8s.io/utils/exec"
"github.com/golang/glog"
"k8s.io/klog"
)
// NewProxyServer returns a new ProxyServer.
@@ -99,7 +99,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
proxyMode := getProxyMode(string(config.Mode), winkernel.WindowsKernelCompatTester{})
if proxyMode == proxyModeKernelspace {
glog.V(0).Info("Using Kernelspace Proxier.")
klog.V(0).Info("Using Kernelspace Proxier.")
proxierKernelspace, err := winkernel.NewProxier(
config.IPTables.SyncPeriod.Duration,
config.IPTables.MinSyncPeriod.Duration,
@@ -118,7 +118,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
endpointsEventHandler = proxierKernelspace
serviceEventHandler = proxierKernelspace
} else {
glog.V(0).Info("Using userspace Proxier.")
klog.V(0).Info("Using userspace Proxier.")
execer := exec.New()
var netshInterface utilnetsh.Interface
netshInterface = utilnetsh.New(execer)
@@ -143,7 +143,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
}
proxier = proxierUserspace
serviceEventHandler = proxierUserspace
glog.V(0).Info("Tearing down pure-winkernel proxy rules.")
klog.V(0).Info("Tearing down pure-winkernel proxy rules.")
winkernel.CleanupLeftovers()
}
@@ -182,13 +182,13 @@ func tryWinKernelSpaceProxy(kcompat winkernel.KernelCompatTester) string {
// guaranteed false on error, error only necessary for debugging
useWinKerelProxy, err := winkernel.CanUseWinKernelProxier(kcompat)
if err != nil {
glog.Errorf("Can't determine whether to use windows kernel proxy, using userspace proxier: %v", err)
klog.Errorf("Can't determine whether to use windows kernel proxy, using userspace proxier: %v", err)
return proxyModeUserspace
}
if useWinKerelProxy {
return proxyModeKernelspace
}
// Fallback.
glog.V(1).Infof("Can't use winkernel proxy, using userspace proxier")
klog.V(1).Infof("Can't use winkernel proxy, using userspace proxier")
return proxyModeUserspace
}