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

@@ -35,7 +35,7 @@ import (
"k8s.io/kubernetes/pkg/controller/namespace/deletion"
"k8s.io/kubernetes/pkg/util/metrics"
"github.com/golang/glog"
"k8s.io/klog"
)
const (
@@ -140,7 +140,7 @@ func (nm *NamespaceController) worker() {
if estimate, ok := err.(*deletion.ResourcesRemainingError); ok {
t := estimate.Estimate/2 + 1
glog.V(4).Infof("Content remaining in namespace %s, waiting %d seconds", key, t)
klog.V(4).Infof("Content remaining in namespace %s, waiting %d seconds", key, t)
nm.queue.AddAfter(key, time.Duration(t)*time.Second)
} else {
// rather than wait for a full resync, re-add the namespace to the queue to be processed
@@ -163,12 +163,12 @@ func (nm *NamespaceController) worker() {
func (nm *NamespaceController) syncNamespaceFromKey(key string) (err error) {
startTime := time.Now()
defer func() {
glog.V(4).Infof("Finished syncing namespace %q (%v)", key, time.Since(startTime))
klog.V(4).Infof("Finished syncing namespace %q (%v)", key, time.Since(startTime))
}()
namespace, err := nm.lister.Get(key)
if errors.IsNotFound(err) {
glog.Infof("Namespace has been deleted %v", key)
klog.Infof("Namespace has been deleted %v", key)
return nil
}
if err != nil {
@@ -183,14 +183,14 @@ func (nm *NamespaceController) Run(workers int, stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer nm.queue.ShutDown()
glog.Infof("Starting namespace controller")
defer glog.Infof("Shutting down namespace controller")
klog.Infof("Starting namespace controller")
defer klog.Infof("Shutting down namespace controller")
if !controller.WaitForCacheSync("namespace", stopCh, nm.listerSynced) {
return
}
glog.V(5).Info("Starting workers of namespace controller")
klog.V(5).Info("Starting workers of namespace controller")
for i := 0; i < workers; i++ {
go wait.Until(nm.worker, time.Second, stopCh)
}