diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 602d797b..2c215582 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -66,10 +66,6 @@ "ImportPath": "github.com/gogo/protobuf/sortkeys", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, { "ImportPath": "github.com/golang/groupcache/lru", "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" @@ -276,343 +272,347 @@ }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/apps/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/auditregistration/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta2", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/coordination/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/scheduling/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627" + "Rev": "a33c8200050fc0751848276811abf3fc029b3133" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "90473842928c717082a393d6adceee99889fe8cc" + "Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0" + }, + { + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" }, { "ImportPath": "sigs.k8s.io/yaml", diff --git a/discovery/cached_discovery.go b/discovery/cached_discovery.go index 90cd3420..df69d6a1 100644 --- a/discovery/cached_discovery.go +++ b/discovery/cached_discovery.go @@ -25,8 +25,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/googleapis/gnostic/OpenAPIv2" + "k8s.io/klog" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -67,23 +67,23 @@ func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion stri if err == nil { cachedResources := &metav1.APIResourceList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedResources); err == nil { - glog.V(10).Infof("returning cached discovery info from %v", filename) + klog.V(10).Infof("returning cached discovery info from %v", filename) return cachedResources, nil } } liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion) if err != nil { - glog.V(3).Infof("skipped caching discovery info due to %v", err) + klog.V(3).Infof("skipped caching discovery info due to %v", err) return liveResources, err } if liveResources == nil || len(liveResources.APIResources) == 0 { - glog.V(3).Infof("skipped caching discovery info, no resources found") + klog.V(3).Infof("skipped caching discovery info, no resources found") return liveResources, err } if err := d.writeCachedFile(filename, liveResources); err != nil { - glog.V(1).Infof("failed to write cache to %v due to %v", filename, err) + klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) } return liveResources, nil @@ -103,23 +103,23 @@ func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { if err == nil { cachedGroups := &metav1.APIGroupList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedGroups); err == nil { - glog.V(10).Infof("returning cached discovery info from %v", filename) + klog.V(10).Infof("returning cached discovery info from %v", filename) return cachedGroups, nil } } liveGroups, err := d.delegate.ServerGroups() if err != nil { - glog.V(3).Infof("skipped caching discovery info due to %v", err) + klog.V(3).Infof("skipped caching discovery info due to %v", err) return liveGroups, err } if liveGroups == nil || len(liveGroups.Groups) == 0 { - glog.V(3).Infof("skipped caching discovery info, no groups found") + klog.V(3).Infof("skipped caching discovery info, no groups found") return liveGroups, err } if err := d.writeCachedFile(filename, liveGroups); err != nil { - glog.V(1).Infof("failed to write cache to %v due to %v", filename, err) + klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) } return liveGroups, nil diff --git a/discovery/round_tripper.go b/discovery/round_tripper.go index 75b7f520..4e2bc24e 100644 --- a/discovery/round_tripper.go +++ b/discovery/round_tripper.go @@ -20,10 +20,10 @@ import ( "net/http" "path/filepath" - "github.com/golang/glog" "github.com/gregjones/httpcache" "github.com/gregjones/httpcache/diskcache" "github.com/peterbourgon/diskv" + "k8s.io/klog" ) type cacheRoundTripper struct { @@ -55,7 +55,7 @@ func (rt *cacheRoundTripper) CancelRequest(req *http.Request) { if cr, ok := rt.rt.Transport.(canceler); ok { cr.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) + klog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) } } diff --git a/examples/workqueue/main.go b/examples/workqueue/main.go index 6768f5d9..c306aaae 100644 --- a/examples/workqueue/main.go +++ b/examples/workqueue/main.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -72,7 +72,7 @@ func (c *Controller) processNextItem() bool { func (c *Controller) syncToStdout(key string) error { obj, exists, err := c.indexer.GetByKey(key) if err != nil { - glog.Errorf("Fetching object with key %s from store failed with %v", key, err) + klog.Errorf("Fetching object with key %s from store failed with %v", key, err) return err } @@ -99,7 +99,7 @@ func (c *Controller) handleErr(err error, key interface{}) { // This controller retries 5 times if something goes wrong. After that, it stops trying. if c.queue.NumRequeues(key) < 5 { - glog.Infof("Error syncing pod %v: %v", key, err) + klog.Infof("Error syncing pod %v: %v", key, err) // Re-enqueue the key rate limited. Based on the rate limiter on the // queue and the re-enqueue history, the key will be processed later again. @@ -110,7 +110,7 @@ func (c *Controller) handleErr(err error, key interface{}) { c.queue.Forget(key) // Report to an external entity that, even after several retries, we could not successfully process this key runtime.HandleError(err) - glog.Infof("Dropping pod %q out of the queue: %v", key, err) + klog.Infof("Dropping pod %q out of the queue: %v", key, err) } func (c *Controller) Run(threadiness int, stopCh chan struct{}) { @@ -118,7 +118,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) { // Let the workers stop when we are done defer c.queue.ShutDown() - glog.Info("Starting Pod controller") + klog.Info("Starting Pod controller") go c.informer.Run(stopCh) @@ -133,7 +133,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) { } <-stopCh - glog.Info("Stopping Pod controller") + klog.Info("Stopping Pod controller") } func (c *Controller) runWorker() { @@ -152,13 +152,13 @@ func main() { // creates the connection config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } // creates the clientset clientset, err := kubernetes.NewForConfig(config) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } // create the pod watcher diff --git a/listers/policy/v1beta1/poddisruptionbudget_expansion.go b/listers/policy/v1beta1/poddisruptionbudget_expansion.go index c0ab9d3e..d07d11a9 100644 --- a/listers/policy/v1beta1/poddisruptionbudget_expansion.go +++ b/listers/policy/v1beta1/poddisruptionbudget_expansion.go @@ -19,11 +19,11 @@ package v1beta1 import ( "fmt" - "github.com/golang/glog" "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" + "k8s.io/klog" ) // PodDisruptionBudgetListerExpansion allows custom methods to be added to @@ -54,7 +54,7 @@ func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]* pdb := list[i] selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector) if err != nil { - glog.Warningf("invalid selector: %v", err) + klog.Warningf("invalid selector: %v", err) // TODO(mml): add an event to the PDB continue } diff --git a/plugin/pkg/client/auth/azure/azure.go b/plugin/pkg/client/auth/azure/azure.go index 9858963e..d42449fc 100644 --- a/plugin/pkg/client/auth/azure/azure.go +++ b/plugin/pkg/client/auth/azure/azure.go @@ -27,7 +27,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/adal" "github.com/Azure/go-autorest/autorest/azure" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" @@ -50,7 +50,7 @@ const ( func init() { if err := restclient.RegisterAuthProviderPlugin("azure", newAzureAuthProvider); err != nil { - glog.Fatalf("Failed to register azure auth plugin: %v", err) + klog.Fatalf("Failed to register azure auth plugin: %v", err) } } @@ -124,7 +124,7 @@ func (r *azureRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) token, err := r.tokenSource.Token() if err != nil { - glog.Errorf("Failed to acquire a token: %v", err) + klog.Errorf("Failed to acquire a token: %v", err) return nil, fmt.Errorf("acquiring a token for authorization header: %v", err) } diff --git a/plugin/pkg/client/auth/exec/exec.go b/plugin/pkg/client/auth/exec/exec.go index cae9d0d6..4d725265 100644 --- a/plugin/pkg/client/auth/exec/exec.go +++ b/plugin/pkg/client/auth/exec/exec.go @@ -31,7 +31,6 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/crypto/ssh/terminal" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -44,6 +43,7 @@ import ( "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/transport" "k8s.io/client-go/util/connrotation" + "k8s.io/klog" ) const execInfoEnv = "KUBERNETES_EXEC_INFO" @@ -228,7 +228,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { Code: int32(res.StatusCode), } if err := r.a.maybeRefreshCreds(creds, resp); err != nil { - glog.Errorf("refreshing credentials: %v", err) + klog.Errorf("refreshing credentials: %v", err) } } return res, nil diff --git a/plugin/pkg/client/auth/gcp/gcp.go b/plugin/pkg/client/auth/gcp/gcp.go index 2bc6c447..e44c2ada 100644 --- a/plugin/pkg/client/auth/gcp/gcp.go +++ b/plugin/pkg/client/auth/gcp/gcp.go @@ -27,18 +27,18 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/yaml" restclient "k8s.io/client-go/rest" "k8s.io/client-go/util/jsonpath" + "k8s.io/klog" ) func init() { if err := restclient.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil { - glog.Fatalf("Failed to register gcp auth plugin: %v", err) + klog.Fatalf("Failed to register gcp auth plugin: %v", err) } } @@ -223,7 +223,7 @@ func (t *cachedTokenSource) Token() (*oauth2.Token, error) { cache := t.update(tok) if t.persister != nil { if err := t.persister.Persist(cache); err != nil { - glog.V(4).Infof("Failed to persist token: %v", err) + klog.V(4).Infof("Failed to persist token: %v", err) } } return tok, nil @@ -329,7 +329,7 @@ func (c *commandTokenSource) parseTokenCmdOutput(output []byte) (*oauth2.Token, } var expiry time.Time if t, err := time.Parse(c.timeFmt, expiryStr); err != nil { - glog.V(4).Infof("Failed to parse token expiry from %s (fmt=%s): %v", expiryStr, c.timeFmt, err) + klog.V(4).Infof("Failed to parse token expiry from %s (fmt=%s): %v", expiryStr, c.timeFmt, err) } else { expiry = t } @@ -373,7 +373,7 @@ func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, err } if res.StatusCode == 401 { - glog.V(4).Infof("The credentials that were supplied are invalid for the target cluster") + klog.V(4).Infof("The credentials that were supplied are invalid for the target cluster") t.persister.Persist(t.resetCache) } diff --git a/plugin/pkg/client/auth/oidc/oidc.go b/plugin/pkg/client/auth/oidc/oidc.go index 9c3ea0ab..1383a97c 100644 --- a/plugin/pkg/client/auth/oidc/oidc.go +++ b/plugin/pkg/client/auth/oidc/oidc.go @@ -28,10 +28,10 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/oauth2" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" + "k8s.io/klog" ) const ( @@ -49,7 +49,7 @@ const ( func init() { if err := restclient.RegisterAuthProviderPlugin("oidc", newOIDCAuthProvider); err != nil { - glog.Fatalf("Failed to register oidc auth plugin: %v", err) + klog.Fatalf("Failed to register oidc auth plugin: %v", err) } } @@ -124,7 +124,7 @@ func newOIDCAuthProvider(_ string, cfg map[string]string, persister restclient.A } if len(cfg[cfgExtraScopes]) > 0 { - glog.V(2).Infof("%s auth provider field depricated, refresh request don't send scopes", + klog.V(2).Infof("%s auth provider field depricated, refresh request don't send scopes", cfgExtraScopes) } diff --git a/plugin/pkg/client/auth/openstack/openstack.go b/plugin/pkg/client/auth/openstack/openstack.go index e6d7f049..fab5104e 100644 --- a/plugin/pkg/client/auth/openstack/openstack.go +++ b/plugin/pkg/client/auth/openstack/openstack.go @@ -22,9 +22,9 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/gophercloud/gophercloud" "github.com/gophercloud/gophercloud/openstack" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" @@ -32,7 +32,7 @@ import ( func init() { if err := restclient.RegisterAuthProviderPlugin("openstack", newOpenstackAuthProvider); err != nil { - glog.Fatalf("Failed to register openstack auth plugin: %s", err) + klog.Fatalf("Failed to register openstack auth plugin: %s", err) } } @@ -62,7 +62,7 @@ func (t *tokenGetter) Token() (string, error) { var err error if t.authOpt == nil { // reads the config from the environment - glog.V(4).Info("reading openstack config from the environment variables") + klog.V(4).Info("reading openstack config from the environment variables") options, err = openstack.AuthOptionsFromEnv() if err != nil { return "", fmt.Errorf("failed to read openstack env vars: %s", err) @@ -126,7 +126,7 @@ func (t *tokenRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) if err == nil { req.Header.Set("Authorization", "Bearer "+token) } else { - glog.V(4).Infof("failed to get token: %s", err) + klog.V(4).Infof("failed to get token: %s", err) } return t.RoundTripper.RoundTrip(req) @@ -140,7 +140,7 @@ func newOpenstackAuthProvider(_ string, config map[string]string, persister rest var ttlDuration time.Duration var err error - glog.Warningf("WARNING: in-tree openstack auth plugin is now deprecated. please use the \"client-keystone-auth\" kubectl/client-go credential plugin instead") + klog.Warningf("WARNING: in-tree openstack auth plugin is now deprecated. please use the \"client-keystone-auth\" kubectl/client-go credential plugin instead") ttl, found := config["ttl"] if !found { ttlDuration = DefaultTTLDuration diff --git a/rest/config.go b/rest/config.go index d5ef8406..438eb3be 100644 --- a/rest/config.go +++ b/rest/config.go @@ -29,7 +29,6 @@ import ( "strings" "time" - "github.com/golang/glog" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -37,6 +36,7 @@ import ( clientcmdapi "k8s.io/client-go/tools/clientcmd/api" certutil "k8s.io/client-go/util/cert" "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog" ) const ( @@ -331,7 +331,7 @@ func InClusterConfig() (*Config, error) { tlsClientConfig := TLSClientConfig{} if _, err := certutil.NewPool(rootCAFile); err != nil { - glog.Errorf("Expected to load root CA config from %s, but got err: %v", rootCAFile, err) + klog.Errorf("Expected to load root CA config from %s, but got err: %v", rootCAFile, err) } else { tlsClientConfig.CAFile = rootCAFile } diff --git a/rest/plugin.go b/rest/plugin.go index cf8fbabf..83ef5ae3 100644 --- a/rest/plugin.go +++ b/rest/plugin.go @@ -21,7 +21,7 @@ import ( "net/http" "sync" - "github.com/golang/glog" + "k8s.io/klog" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) @@ -57,7 +57,7 @@ func RegisterAuthProviderPlugin(name string, plugin Factory) error { if _, found := plugins[name]; found { return fmt.Errorf("Auth Provider Plugin %q was registered twice", name) } - glog.V(4).Infof("Registered Auth Provider Plugin %q", name) + klog.V(4).Infof("Registered Auth Provider Plugin %q", name) plugins[name] = plugin return nil } diff --git a/rest/request.go b/rest/request.go index 9bb31144..64901fba 100644 --- a/rest/request.go +++ b/rest/request.go @@ -32,7 +32,6 @@ import ( "strings" "time" - "github.com/golang/glog" "golang.org/x/net/http2" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -44,6 +43,7 @@ import ( restclientwatch "k8s.io/client-go/rest/watch" "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog" ) var ( @@ -114,7 +114,7 @@ type Request struct { // NewRequest creates a new request helper object for accessing runtime.Objects on a server. func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter, timeout time.Duration) *Request { if backoff == nil { - glog.V(2).Infof("Not implementing request backoff strategy.") + klog.V(2).Infof("Not implementing request backoff strategy.") backoff = &NoBackoff{} } @@ -527,7 +527,7 @@ func (r *Request) tryThrottle() { r.throttle.Accept() } if latency := time.Since(now); latency > longThrottleLatency { - glog.V(4).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) + klog.V(4).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) } } @@ -683,7 +683,7 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { }() if r.err != nil { - glog.V(4).Infof("Error in request: %v", r.err) + klog.V(4).Infof("Error in request: %v", r.err) return r.err } @@ -770,13 +770,13 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { if seeker, ok := r.body.(io.Seeker); ok && r.body != nil { _, err := seeker.Seek(0, 0) if err != nil { - glog.V(4).Infof("Could not retry request, can't Seek() back to beginning of body for %T", r.body) + klog.V(4).Infof("Could not retry request, can't Seek() back to beginning of body for %T", r.body) fn(req, resp) return true } } - glog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) + klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) r.backoffMgr.Sleep(time.Duration(seconds) * time.Second) return false } @@ -844,13 +844,13 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu // 2. Apiserver sends back the headers and then part of the body // 3. Apiserver closes connection. // 4. client-go should catch this and return an error. - glog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) + klog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) streamErr := fmt.Errorf("Stream error %#v when reading response body, may be caused by closed connection. Please retry.", err) return Result{ err: streamErr, } default: - glog.Errorf("Unexpected error when reading response body: %#v", err) + klog.Errorf("Unexpected error when reading response body: %#v", err) unexpectedErr := fmt.Errorf("Unexpected error %#v when reading response body. Please retry.", err) return Result{ err: unexpectedErr, @@ -914,11 +914,11 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu func truncateBody(body string) string { max := 0 switch { - case bool(glog.V(10)): + case bool(klog.V(10)): return body - case bool(glog.V(9)): + case bool(klog.V(9)): max = 10240 - case bool(glog.V(8)): + case bool(klog.V(8)): max = 1024 } @@ -933,13 +933,13 @@ func truncateBody(body string) string { // allocating a new string for the body output unless necessary. Uses a simple heuristic to determine // whether the body is printable. func glogBody(prefix string, body []byte) { - if glog.V(8) { + if klog.V(8) { if bytes.IndexFunc(body, func(r rune) bool { return r < 0x0a }) != -1 { - glog.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body))) + klog.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body))) } else { - glog.Infof("%s: %s", prefix, truncateBody(string(body))) + klog.Infof("%s: %s", prefix, truncateBody(string(body))) } } } @@ -1141,7 +1141,7 @@ func (r Result) Error() error { // to be backwards compatible with old servers that do not return a version, default to "v1" out, _, err := r.decoder.Decode(r.body, &schema.GroupVersionKind{Version: "v1"}, nil) if err != nil { - glog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) + klog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) return r.err } switch t := out.(type) { diff --git a/rest/request_test.go b/rest/request_test.go index 2660c0be..a415f60a 100755 --- a/rest/request_test.go +++ b/rest/request_test.go @@ -35,7 +35,7 @@ import ( "testing" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" @@ -1855,6 +1855,10 @@ func buildString(length int) string { return string(s) } +func init() { + klog.InitFlags(nil) +} + func TestTruncateBody(t *testing.T) { tests := []struct { body string @@ -1904,7 +1908,7 @@ func TestTruncateBody(t *testing.T) { }, } - l := flag.Lookup("v").Value.(flag.Getter).Get().(glog.Level) + l := flag.Lookup("v").Value.(flag.Getter).Get().(klog.Level) for _, test := range tests { flag.Set("v", test.level) got := truncateBody(test.body) diff --git a/rest/token_source.go b/rest/token_source.go index e0a6eb7d..c251b5eb 100644 --- a/rest/token_source.go +++ b/rest/token_source.go @@ -24,8 +24,8 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/oauth2" + "k8s.io/klog" ) // TokenSourceWrapTransport returns a WrapTransport that injects bearer tokens @@ -131,7 +131,7 @@ func (ts *cachingTokenSource) Token() (*oauth2.Token, error) { if ts.tok == nil { return nil, err } - glog.Errorf("Unable to rotate token: %v", err) + klog.Errorf("Unable to rotate token: %v", err) return ts.tok, nil } diff --git a/rest/urlbackoff.go b/rest/urlbackoff.go index eff848ab..d00e42f8 100644 --- a/rest/urlbackoff.go +++ b/rest/urlbackoff.go @@ -20,9 +20,9 @@ import ( "net/url" "time" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog" ) // Set of resp. Codes that we backoff for. @@ -64,7 +64,7 @@ func (n *NoBackoff) Sleep(d time.Duration) { // Disable makes the backoff trivial, i.e., sets it to zero. This might be used // by tests which want to run 1000s of mock requests without slowing down. func (b *URLBackoff) Disable() { - glog.V(4).Infof("Disabling backoff strategy") + klog.V(4).Infof("Disabling backoff strategy") b.Backoff = flowcontrol.NewBackOff(0*time.Second, 0*time.Second) } @@ -76,7 +76,7 @@ func (b *URLBackoff) baseUrlKey(rawurl *url.URL) string { // in the future. host, err := url.Parse(rawurl.String()) if err != nil { - glog.V(4).Infof("Error extracting url: %v", rawurl) + klog.V(4).Infof("Error extracting url: %v", rawurl) panic("bad url!") } return host.Host @@ -89,7 +89,7 @@ func (b *URLBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode i b.Backoff.Next(b.baseUrlKey(actualUrl), b.Backoff.Clock.Now()) return } else if responseCode >= 300 || err != nil { - glog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err) + klog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err) } //If we got this far, there is no backoff required for this URL anymore. diff --git a/restmapper/discovery.go b/restmapper/discovery.go index aa158626..84491f4c 100644 --- a/restmapper/discovery.go +++ b/restmapper/discovery.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" - "github.com/golang/glog" + "k8s.io/klog" ) // APIGroupResources is an API group with a mapping of versions to @@ -212,7 +212,7 @@ func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) { // Reset resets the internally cached Discovery information and will // cause the next mapping request to re-discover. func (d *DeferredDiscoveryRESTMapper) Reset() { - glog.V(5).Info("Invalidating discovery information") + klog.V(5).Info("Invalidating discovery information") d.initMu.Lock() defer d.initMu.Unlock() diff --git a/restmapper/shortcut.go b/restmapper/shortcut.go index d9f4be0b..6f3c9d93 100644 --- a/restmapper/shortcut.go +++ b/restmapper/shortcut.go @@ -19,7 +19,7 @@ package restmapper import ( "strings" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -86,12 +86,12 @@ func (e shortcutExpander) getShortcutMappings() ([]*metav1.APIResourceList, []re // This can return an error *and* the results it was able to find. We don't need to fail on the error. apiResList, err := e.discoveryClient.ServerResources() if err != nil { - glog.V(1).Infof("Error loading discovery information: %v", err) + klog.V(1).Infof("Error loading discovery information: %v", err) } for _, apiResources := range apiResList { gv, err := schema.ParseGroupVersion(apiResources.GroupVersion) if err != nil { - glog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error()) + klog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error()) continue } for _, apiRes := range apiResources.APIResources { diff --git a/tools/cache/delta_fifo.go b/tools/cache/delta_fifo.go index 45c3b500..ded637ac 100644 --- a/tools/cache/delta_fifo.go +++ b/tools/cache/delta_fifo.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" - "github.com/golang/glog" + "k8s.io/klog" ) // NewDeltaFIFO returns a Store which can be used process changes to items. @@ -506,10 +506,10 @@ func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { deletedObj, exists, err := f.knownObjects.GetByKey(k) if err != nil { deletedObj = nil - glog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k) + klog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k) } else if !exists { deletedObj = nil - glog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k) + klog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k) } queuedDeletions++ if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil { @@ -553,10 +553,10 @@ func (f *DeltaFIFO) syncKey(key string) error { func (f *DeltaFIFO) syncKeyLocked(key string) error { obj, exists, err := f.knownObjects.GetByKey(key) if err != nil { - glog.Errorf("Unexpected error %v during lookup of key %v, unable to queue object for sync", err, key) + klog.Errorf("Unexpected error %v during lookup of key %v, unable to queue object for sync", err, key) return nil } else if !exists { - glog.Infof("Key %v does not exist in known objects store, unable to queue object for sync", key) + klog.Infof("Key %v does not exist in known objects store, unable to queue object for sync", key) return nil } diff --git a/tools/cache/expiration_cache.go b/tools/cache/expiration_cache.go index d284453e..b38fe70b 100644 --- a/tools/cache/expiration_cache.go +++ b/tools/cache/expiration_cache.go @@ -20,8 +20,8 @@ import ( "sync" "time" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/clock" + "k8s.io/klog" ) // ExpirationCache implements the store interface @@ -95,7 +95,7 @@ func (c *ExpirationCache) getOrExpire(key string) (interface{}, bool) { return nil, false } if c.expirationPolicy.IsExpired(timestampedItem) { - glog.V(4).Infof("Entry %v: %+v has expired", key, timestampedItem.obj) + klog.V(4).Infof("Entry %v: %+v has expired", key, timestampedItem.obj) c.cacheStorage.Delete(key) return nil, false } diff --git a/tools/cache/listers.go b/tools/cache/listers.go index 27d51a6b..ce377329 100644 --- a/tools/cache/listers.go +++ b/tools/cache/listers.go @@ -17,7 +17,7 @@ limitations under the License. package cache import ( - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" @@ -60,7 +60,7 @@ func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selec items, err := indexer.Index(NamespaceIndex, &metav1.ObjectMeta{Namespace: namespace}) if err != nil { // Ignore error; do slow search without index. - glog.Warningf("can not retrieve list of objects using index : %v", err) + klog.Warningf("can not retrieve list of objects using index : %v", err) for _, m := range indexer.List() { metadata, err := meta.Accessor(m) if err != nil { diff --git a/tools/cache/mutation_cache.go b/tools/cache/mutation_cache.go index cbb6434e..4c6686e9 100644 --- a/tools/cache/mutation_cache.go +++ b/tools/cache/mutation_cache.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" @@ -156,7 +156,7 @@ func (c *mutationCache) ByIndex(name string, indexKey string) ([]interface{}, er } elements, err := fn(updated) if err != nil { - glog.V(4).Infof("Unable to calculate an index entry for mutation cache entry %s: %v", key, err) + klog.V(4).Infof("Unable to calculate an index entry for mutation cache entry %s: %v", key, err) continue } for _, inIndex := range elements { diff --git a/tools/cache/mutation_detector.go b/tools/cache/mutation_detector.go index e2aa4484..adb5b8be 100644 --- a/tools/cache/mutation_detector.go +++ b/tools/cache/mutation_detector.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" @@ -45,7 +45,7 @@ func NewCacheMutationDetector(name string) CacheMutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } - glog.Warningln("Mutation detector is enabled, this will result in memory leakage.") + klog.Warningln("Mutation detector is enabled, this will result in memory leakage.") return &defaultCacheMutationDetector{name: name, period: 1 * time.Second} } diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 9ee7efcb..12e2a334 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -31,7 +31,6 @@ import ( "syscall" "time" - "github.com/golang/glog" apierrs "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,6 +40,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" + "k8s.io/klog" ) // Reflector watches a specified resource and causes all changes to be reflected in the given store. @@ -128,7 +128,7 @@ var internalPackages = []string{"client-go/tools/cache/"} // Run starts a watch and handles watch events. Will restart the watch if it is closed. // Run will exit when stopCh is closed. func (r *Reflector) Run(stopCh <-chan struct{}) { - glog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedType, r.resyncPeriod, r.name) + klog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedType, r.resyncPeriod, r.name) wait.Until(func() { if err := r.ListAndWatch(stopCh); err != nil { utilruntime.HandleError(err) @@ -166,7 +166,7 @@ func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) { // and then use the resource version to watch. // It returns error if ListAndWatch didn't even try to initialize watch. func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { - glog.V(3).Infof("Listing and watching %v from %s", r.expectedType, r.name) + klog.V(3).Infof("Listing and watching %v from %s", r.expectedType, r.name) var resourceVersion string // Explicitly set "0" as resource version - it's fine for the List() @@ -212,7 +212,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { return } if r.ShouldResync == nil || r.ShouldResync() { - glog.V(4).Infof("%s: forcing resync", r.name) + klog.V(4).Infof("%s: forcing resync", r.name) if err := r.store.Resync(); err != nil { resyncerrc <- err return @@ -246,7 +246,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { case io.EOF: // watch closed normally case io.ErrUnexpectedEOF: - glog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedType, err) + klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedType, err) default: utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.expectedType, err)) } @@ -267,7 +267,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { if err := r.watchHandler(w, &resourceVersion, resyncerrc, stopCh); err != nil { if err != errorStopRequested { - glog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) + klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) } return nil } @@ -354,7 +354,7 @@ loop: r.metrics.numberOfShortWatches.Inc() return fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", r.name) } - glog.V(4).Infof("%s: Watch close - %v total %v items received", r.name, r.expectedType, eventCount) + klog.V(4).Infof("%s: Watch close - %v total %v items received", r.name, r.expectedType, eventCount) return nil } diff --git a/tools/cache/shared_informer.go b/tools/cache/shared_informer.go index f29a4b33..e91fc9e9 100644 --- a/tools/cache/shared_informer.go +++ b/tools/cache/shared_informer.go @@ -28,7 +28,7 @@ import ( "k8s.io/client-go/util/buffer" "k8s.io/client-go/util/retry" - "github.com/golang/glog" + "k8s.io/klog" ) // SharedInformer has a shared data cache and is capable of distributing notifications for changes @@ -116,11 +116,11 @@ func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool }, stopCh) if err != nil { - glog.V(2).Infof("stop requested") + klog.V(2).Infof("stop requested") return false } - glog.V(4).Infof("caches populated") + klog.V(4).Infof("caches populated") return true } @@ -279,11 +279,11 @@ func determineResyncPeriod(desired, check time.Duration) time.Duration { return desired } if check == 0 { - glog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired) + klog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired) return 0 } if desired < check { - glog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check) + klog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check) return check } return desired @@ -296,19 +296,19 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv defer s.startedLock.Unlock() if s.stopped { - glog.V(2).Infof("Handler %v was not added to shared informer because it has stopped already", handler) + klog.V(2).Infof("Handler %v was not added to shared informer because it has stopped already", handler) return } if resyncPeriod > 0 { if resyncPeriod < minimumResyncPeriod { - glog.Warningf("resyncPeriod %d is too small. Changing it to the minimum allowed value of %d", resyncPeriod, minimumResyncPeriod) + klog.Warningf("resyncPeriod %d is too small. Changing it to the minimum allowed value of %d", resyncPeriod, minimumResyncPeriod) resyncPeriod = minimumResyncPeriod } if resyncPeriod < s.resyncCheckPeriod { if s.started { - glog.Warningf("resyncPeriod %d is smaller than resyncCheckPeriod %d and the informer has already started. Changing it to %d", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod) + klog.Warningf("resyncPeriod %d is smaller than resyncCheckPeriod %d and the informer has already started. Changing it to %d", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod) resyncPeriod = s.resyncCheckPeriod } else { // if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update diff --git a/tools/clientcmd/client_config.go b/tools/clientcmd/client_config.go index e5dc921f..dea229c9 100644 --- a/tools/clientcmd/client_config.go +++ b/tools/clientcmd/client_config.go @@ -24,8 +24,8 @@ import ( "os" "strings" - "github.com/golang/glog" "github.com/imdario/mergo" + "k8s.io/klog" restclient "k8s.io/client-go/rest" clientauth "k8s.io/client-go/tools/auth" @@ -545,12 +545,12 @@ func (config *inClusterClientConfig) Possible() bool { // to the default config. func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) { if kubeconfigPath == "" && masterUrl == "" { - glog.Warningf("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.") + klog.Warningf("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.") kubeconfig, err := restclient.InClusterConfig() if err == nil { return kubeconfig, nil } - glog.Warning("error creating inClusterConfig, falling back to default config: ", err) + klog.Warning("error creating inClusterConfig, falling back to default config: ", err) } return NewNonInteractiveDeferredLoadingClientConfig( &ClientConfigLoadingRules{ExplicitPath: kubeconfigPath}, diff --git a/tools/clientcmd/config.go b/tools/clientcmd/config.go index 9495849b..b8cc3968 100644 --- a/tools/clientcmd/config.go +++ b/tools/clientcmd/config.go @@ -24,7 +24,7 @@ import ( "reflect" "sort" - "github.com/golang/glog" + "k8s.io/klog" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" @@ -483,7 +483,7 @@ func getConfigFromFile(filename string) (*clientcmdapi.Config, error) { func GetConfigFromFileOrDie(filename string) *clientcmdapi.Config { config, err := getConfigFromFile(filename) if err != nil { - glog.FatalDepth(1, err) + klog.FatalDepth(1, err) } return config diff --git a/tools/clientcmd/loader.go b/tools/clientcmd/loader.go index 6038c8d4..7e928a91 100644 --- a/tools/clientcmd/loader.go +++ b/tools/clientcmd/loader.go @@ -27,8 +27,8 @@ import ( goruntime "runtime" "strings" - "github.com/golang/glog" "github.com/imdario/mergo" + "k8s.io/klog" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -356,7 +356,7 @@ func LoadFromFile(filename string) (*clientcmdapi.Config, error) { if err != nil { return nil, err } - glog.V(6).Infoln("Config loaded from file", filename) + klog.V(6).Infoln("Config loaded from file", filename) // set LocationOfOrigin on every Cluster, User, and Context for key, obj := range config.AuthInfos { diff --git a/tools/clientcmd/merged_client_builder.go b/tools/clientcmd/merged_client_builder.go index 05038133..76380db8 100644 --- a/tools/clientcmd/merged_client_builder.go +++ b/tools/clientcmd/merged_client_builder.go @@ -20,7 +20,7 @@ import ( "io" "sync" - "github.com/golang/glog" + "k8s.io/klog" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" @@ -119,7 +119,7 @@ func (config *DeferredLoadingClientConfig) ClientConfig() (*restclient.Config, e // check for in-cluster configuration and use it if config.icc.Possible() { - glog.V(4).Infof("Using in-cluster configuration") + klog.V(4).Infof("Using in-cluster configuration") return config.icc.ClientConfig() } @@ -156,7 +156,7 @@ func (config *DeferredLoadingClientConfig) Namespace() (string, bool, error) { } } - glog.V(4).Infof("Using in-cluster namespace") + klog.V(4).Infof("Using in-cluster namespace") // allow the namespace from the service account token directory to be used. return config.icc.Namespace() diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index be52e85a..1bd6167b 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -60,7 +60,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" rl "k8s.io/client-go/tools/leaderelection/resourcelock" - "github.com/golang/glog" + "k8s.io/klog" ) const ( @@ -184,16 +184,16 @@ func (le *LeaderElector) acquire(ctx context.Context) bool { defer cancel() succeeded := false desc := le.config.Lock.Describe() - glog.Infof("attempting to acquire leader lease %v...", desc) + klog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { succeeded = le.tryAcquireOrRenew() le.maybeReportTransition() if !succeeded { - glog.V(4).Infof("failed to acquire lease %v", desc) + klog.V(4).Infof("failed to acquire lease %v", desc) return } le.config.Lock.RecordEvent("became leader") - glog.Infof("successfully acquired lease %v", desc) + klog.Infof("successfully acquired lease %v", desc) cancel() }, le.config.RetryPeriod, JitterFactor, true, ctx.Done()) return succeeded @@ -224,11 +224,11 @@ func (le *LeaderElector) renew(ctx context.Context) { le.maybeReportTransition() desc := le.config.Lock.Describe() if err == nil { - glog.V(5).Infof("successfully renewed lease %v", desc) + klog.V(5).Infof("successfully renewed lease %v", desc) return } le.config.Lock.RecordEvent("stopped leading") - glog.Infof("failed to renew lease %v: %v", desc, err) + klog.Infof("failed to renew lease %v: %v", desc, err) cancel() }, le.config.RetryPeriod, ctx.Done()) } @@ -249,11 +249,11 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { oldLeaderElectionRecord, err := le.config.Lock.Get() if err != nil { if !errors.IsNotFound(err) { - glog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) + klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) return false } if err = le.config.Lock.Create(leaderElectionRecord); err != nil { - glog.Errorf("error initially creating leader election record: %v", err) + klog.Errorf("error initially creating leader election record: %v", err) return false } le.observedRecord = leaderElectionRecord @@ -268,7 +268,7 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { } if le.observedTime.Add(le.config.LeaseDuration).After(now.Time) && !le.IsLeader() { - glog.V(4).Infof("lock is held by %v and has not yet expired", oldLeaderElectionRecord.HolderIdentity) + klog.V(4).Infof("lock is held by %v and has not yet expired", oldLeaderElectionRecord.HolderIdentity) return false } @@ -283,7 +283,7 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { // update the lock itself if err = le.config.Lock.Update(leaderElectionRecord); err != nil { - glog.Errorf("Failed to update lock: %v", err) + klog.Errorf("Failed to update lock: %v", err) return false } le.observedRecord = leaderElectionRecord diff --git a/tools/record/event.go b/tools/record/event.go index 168dfa80..2ee69589 100644 --- a/tools/record/event.go +++ b/tools/record/event.go @@ -33,7 +33,7 @@ import ( "net/http" - "github.com/golang/glog" + "k8s.io/klog" ) const maxTriesPerEvent = 12 @@ -144,7 +144,7 @@ func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrela } tries++ if tries >= maxTriesPerEvent { - glog.Errorf("Unable to write event '%#v' (retry limit exceeded!)", event) + klog.Errorf("Unable to write event '%#v' (retry limit exceeded!)", event) break } // Randomize the first sleep so that various clients won't all be @@ -194,13 +194,13 @@ func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEv switch err.(type) { case *restclient.RequestConstructionError: // We will construct the request the same next time, so don't keep trying. - glog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err) + klog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err) return true case *errors.StatusError: if errors.IsAlreadyExists(err) { - glog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err) + klog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err) } else { - glog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err) + klog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err) } return true case *errors.UnexpectedObjectError: @@ -209,7 +209,7 @@ func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEv default: // This case includes actual http transport errors. Go ahead and retry. } - glog.Errorf("Unable to write event: '%v' (may retry after sleeping)", err) + klog.Errorf("Unable to write event: '%v' (may retry after sleeping)", err) return false } @@ -256,12 +256,12 @@ type recorderImpl struct { func (recorder *recorderImpl) generateEvent(object runtime.Object, annotations map[string]string, timestamp metav1.Time, eventtype, reason, message string) { ref, err := ref.GetReference(recorder.scheme, object) if err != nil { - glog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) + klog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) return } if !validateEventType(eventtype) { - glog.Errorf("Unsupported event type: '%v'", eventtype) + klog.Errorf("Unsupported event type: '%v'", eventtype) return } diff --git a/tools/remotecommand/remotecommand.go b/tools/remotecommand/remotecommand.go index d2b29861..892d8d10 100644 --- a/tools/remotecommand/remotecommand.go +++ b/tools/remotecommand/remotecommand.go @@ -22,7 +22,7 @@ import ( "net/http" "net/url" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/remotecommand" @@ -132,7 +132,7 @@ func (e *streamExecutor) Stream(options StreamOptions) error { case remotecommand.StreamProtocolV2Name: streamer = newStreamProtocolV2(options) case "": - glog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) + klog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) fallthrough case remotecommand.StreamProtocolV1Name: streamer = newStreamProtocolV1(options) diff --git a/tools/remotecommand/v1.go b/tools/remotecommand/v1.go index 92dad727..81cc93ec 100644 --- a/tools/remotecommand/v1.go +++ b/tools/remotecommand/v1.go @@ -22,9 +22,9 @@ import ( "io/ioutil" "net/http" - "github.com/golang/glog" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/klog" ) // streamProtocolV1 implements the first version of the streaming exec & attach @@ -53,10 +53,10 @@ func (p *streamProtocolV1) stream(conn streamCreator) error { errorChan := make(chan error) cp := func(s string, dst io.Writer, src io.Reader) { - glog.V(6).Infof("Copying %s", s) - defer glog.V(6).Infof("Done copying %s", s) + klog.V(6).Infof("Copying %s", s) + defer klog.V(6).Infof("Done copying %s", s) if _, err := io.Copy(dst, src); err != nil && err != io.EOF { - glog.Errorf("Error copying %s: %v", s, err) + klog.Errorf("Error copying %s: %v", s, err) } if s == v1.StreamTypeStdout || s == v1.StreamTypeStderr { doneChan <- struct{}{} diff --git a/tools/watch/until.go b/tools/watch/until.go index 93357884..aa4bbc21 100644 --- a/tools/watch/until.go +++ b/tools/watch/until.go @@ -22,13 +22,13 @@ import ( "fmt" "time" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" + "k8s.io/klog" ) // PreconditionFunc returns true if the condition has been reached, false if it has not been reached yet, @@ -135,7 +135,7 @@ func UntilWithSync(ctx context.Context, lw cache.ListerWatcher, objType runtime. func ContextWithOptionalTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { if timeout < 0 { // This should be handled in validation - glog.Errorf("Timeout for context shall not be negative!") + klog.Errorf("Timeout for context shall not be negative!") timeout = 0 } diff --git a/transport/round_trippers.go b/transport/round_trippers.go index 0ebcbbc8..da417cf9 100644 --- a/transport/round_trippers.go +++ b/transport/round_trippers.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/golang/glog" + "k8s.io/klog" utilnet "k8s.io/apimachinery/pkg/util/net" ) @@ -62,13 +62,13 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip // DebugWrappers wraps a round tripper and logs based on the current log level. func DebugWrappers(rt http.RoundTripper) http.RoundTripper { switch { - case bool(glog.V(9)): + case bool(klog.V(9)): rt = newDebuggingRoundTripper(rt, debugCurlCommand, debugURLTiming, debugResponseHeaders) - case bool(glog.V(8)): + case bool(klog.V(8)): rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus, debugResponseHeaders) - case bool(glog.V(7)): + case bool(klog.V(7)): rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus) - case bool(glog.V(6)): + case bool(klog.V(6)): rt = newDebuggingRoundTripper(rt, debugURLTiming) } @@ -138,7 +138,7 @@ func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -166,7 +166,7 @@ func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -197,7 +197,7 @@ func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -257,7 +257,7 @@ func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.delegate.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.delegate) + klog.Errorf("CancelRequest not implemented by %T", rt.delegate) } } @@ -288,7 +288,7 @@ func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -372,7 +372,7 @@ func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.delegatedRoundTripper.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.delegatedRoundTripper) + klog.Errorf("CancelRequest not implemented by %T", rt.delegatedRoundTripper) } } @@ -380,17 +380,17 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e reqInfo := newRequestInfo(req) if rt.levels[debugJustURL] { - glog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL) + klog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL) } if rt.levels[debugCurlCommand] { - glog.Infof("%s", reqInfo.toCurl()) + klog.Infof("%s", reqInfo.toCurl()) } if rt.levels[debugRequestHeaders] { - glog.Infof("Request Headers:") + klog.Infof("Request Headers:") for key, values := range reqInfo.RequestHeaders { for _, value := range values { - glog.Infof(" %s: %s", key, value) + klog.Infof(" %s: %s", key, value) } } } @@ -402,16 +402,16 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e reqInfo.complete(response, err) if rt.levels[debugURLTiming] { - glog.Infof("%s %s %s in %d milliseconds", reqInfo.RequestVerb, reqInfo.RequestURL, reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) + klog.Infof("%s %s %s in %d milliseconds", reqInfo.RequestVerb, reqInfo.RequestURL, reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) } if rt.levels[debugResponseStatus] { - glog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) + klog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) } if rt.levels[debugResponseHeaders] { - glog.Infof("Response Headers:") + klog.Infof("Response Headers:") for key, values := range reqInfo.ResponseHeaders { for _, value := range values { - glog.Infof(" %s: %s", key, value) + klog.Infof(" %s: %s", key, value) } } } diff --git a/util/certificate/certificate_manager.go b/util/certificate/certificate_manager.go index fbdf4ec7..ed74559e 100644 --- a/util/certificate/certificate_manager.go +++ b/util/certificate/certificate_manager.go @@ -28,7 +28,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" certificates "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -227,17 +227,17 @@ func (m *manager) Start() { // signing API, so don't start the certificate manager if we don't have a // client. if m.certSigningRequestClient == nil { - glog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") + klog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") return } - glog.V(2).Infof("Certificate rotation is enabled.") + klog.V(2).Infof("Certificate rotation is enabled.") templateChanged := make(chan struct{}) go wait.Forever(func() { deadline := m.nextRotationDeadline() if sleepInterval := deadline.Sub(time.Now()); sleepInterval > 0 { - glog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) + klog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) timer := time.NewTimer(sleepInterval) defer timer.Stop() @@ -250,7 +250,7 @@ func (m *manager) Start() { // if the template now matches what we last requested, restart the rotation deadline loop return } - glog.V(2).Infof("Certificate template changed, rotating") + klog.V(2).Infof("Certificate template changed, rotating") } } @@ -321,7 +321,7 @@ func getCurrentCertificateOrBootstrap( if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil { utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err)) } else { - glog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") + klog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") } return &bootstrapCert, true, nil @@ -333,7 +333,7 @@ func getCurrentCertificateOrBootstrap( // This method also keeps track of "server health" by interpreting the responses it gets // from the server on the various calls it makes. func (m *manager) rotateCerts() (bool, error) { - glog.V(2).Infof("Rotating certificates") + klog.V(2).Infof("Rotating certificates") template, csrPEM, keyPEM, privateKey, err := m.generateCSR() if err != nil { @@ -403,7 +403,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { if template := m.getTemplate(); template != nil { if template.Subject.CommonName != m.cert.Leaf.Subject.CommonName { - glog.V(2).Infof("Current certificate CN (%s) does not match requested CN (%s)", m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) + klog.V(2).Infof("Current certificate CN (%s) does not match requested CN (%s)", m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) return false } @@ -411,7 +411,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { desiredDNSNames := sets.NewString(template.DNSNames...) missingDNSNames := desiredDNSNames.Difference(currentDNSNames) if len(missingDNSNames) > 0 { - glog.V(2).Infof("Current certificate is missing requested DNS names %v", missingDNSNames.List()) + klog.V(2).Infof("Current certificate is missing requested DNS names %v", missingDNSNames.List()) return false } @@ -425,7 +425,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { } missingIPs := desiredIPs.Difference(currentIPs) if len(missingIPs) > 0 { - glog.V(2).Infof("Current certificate is missing requested IP addresses %v", missingIPs.List()) + klog.V(2).Infof("Current certificate is missing requested IP addresses %v", missingIPs.List()) return false } @@ -433,7 +433,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { desiredOrgs := sets.NewString(template.Subject.Organization...) missingOrgs := desiredOrgs.Difference(currentOrgs) if len(missingOrgs) > 0 { - glog.V(2).Infof("Current certificate is missing requested orgs %v", missingOrgs.List()) + klog.V(2).Infof("Current certificate is missing requested orgs %v", missingOrgs.List()) return false } } @@ -468,7 +468,7 @@ func (m *manager) nextRotationDeadline() time.Time { totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore)) deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - glog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) + klog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) if m.certificateExpiration != nil { m.certificateExpiration.Set(float64(notAfter.Unix())) } diff --git a/util/certificate/certificate_store.go b/util/certificate/certificate_store.go index 81a9e764..d2666615 100644 --- a/util/certificate/certificate_store.go +++ b/util/certificate/certificate_store.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/golang/glog" + "k8s.io/klog" ) const ( @@ -127,7 +127,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) { if pairFileExists, err := fileExists(pairFile); err != nil { return nil, err } else if pairFileExists { - glog.Infof("Loading cert/key pair from %q.", pairFile) + klog.Infof("Loading cert/key pair from %q.", pairFile) return loadFile(pairFile) } @@ -140,7 +140,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) { return nil, err } if certFileExists && keyFileExists { - glog.Infof("Loading cert/key pair from (%q, %q).", s.certFile, s.keyFile) + klog.Infof("Loading cert/key pair from (%q, %q).", s.certFile, s.keyFile) return loadX509KeyPair(s.certFile, s.keyFile) } @@ -155,7 +155,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) { return nil, err } if certFileExists && keyFileExists { - glog.Infof("Loading cert/key pair from (%q, %q).", c, k) + klog.Infof("Loading cert/key pair from (%q, %q).", c, k) return loadX509KeyPair(c, k) } diff --git a/util/certificate/csr/csr.go b/util/certificate/csr/csr.go index 4a53352f..04a4a03d 100644 --- a/util/certificate/csr/csr.go +++ b/util/certificate/csr/csr.go @@ -27,7 +27,7 @@ import ( "reflect" "time" - "github.com/golang/glog" + "k8s.io/klog" certificates "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -104,7 +104,7 @@ func RequestCertificate(client certificatesclient.CertificateSigningRequestInter switch { case err == nil: case errors.IsAlreadyExists(err) && len(name) > 0: - glog.Infof("csr for this node already exists, reusing") + klog.Infof("csr for this node already exists, reusing") req, err = client.Get(name, metav1.GetOptions{}) if err != nil { return nil, formatError("cannot retrieve certificate signing request: %v", err) @@ -112,7 +112,7 @@ func RequestCertificate(client certificatesclient.CertificateSigningRequestInter if err := ensureCompatible(req, csr, privateKey); err != nil { return nil, fmt.Errorf("retrieved csr is not compatible: %v", err) } - glog.Infof("csr for this node is still valid") + klog.Infof("csr for this node is still valid") default: return nil, formatError("cannot create certificate signing request: %v", err) }