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

@@ -23,8 +23,8 @@ import (
"io"
"net/url"
"github.com/golang/glog"
"github.com/spf13/cobra"
"k8s.io/klog"
kapierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
@@ -471,7 +471,7 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e
} else {
// if we are unable to decode server response into a v1beta1.Table,
// fallback to client-side printing with whatever info the server returned.
glog.V(2).Infof("Unable to decode server response into a Table. Falling back to hardcoded types: %v", err)
klog.V(2).Infof("Unable to decode server response into a Table. Falling back to hardcoded types: %v", err)
}
}
@@ -555,7 +555,7 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e
internalObj, err := legacyscheme.Scheme.ConvertToVersion(info.Object, info.Mapping.GroupVersionKind.GroupKind().WithVersion(runtime.APIVersionInternal).GroupVersion())
if err != nil {
// if there's an error, try to print what you have (mirrors old behavior).
glog.V(1).Info(err)
klog.V(1).Info(err)
printer.PrintObj(info.Object, w)
} else {
printer.PrintObj(internalObj, w)
@@ -704,7 +704,7 @@ func (o *GetOptions) watch(f cmdutil.Factory, cmd *cobra.Command, args []string)
func attemptToConvertToInternal(obj runtime.Object, converter runtime.ObjectConvertor, targetVersion schema.GroupVersion) runtime.Object {
internalObject, err := converter.ConvertToVersion(obj, targetVersion)
if err != nil {
glog.V(1).Infof("Unable to convert %T to %v: %v", obj, targetVersion, err)
klog.V(1).Infof("Unable to convert %T to %v: %v", obj, targetVersion, err)
return obj
}
return internalObject