mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-24 14:12:18 +00:00
Merge pull request #70889 from dims/update-cadvisor-and-other-repos-for-klog-take-2
Update cadvisor and other repos for klog Kubernetes-commit: a3ccea9d8743f2ff82e41b6c2af6dc2c41dc7b10
This commit is contained in:
commit
ee7a1ba5cd
178
Godeps/Godeps.json
generated
178
Godeps/Godeps.json
generated
@ -66,10 +66,6 @@
|
|||||||
"ImportPath": "github.com/gogo/protobuf/sortkeys",
|
"ImportPath": "github.com/gogo/protobuf/sortkeys",
|
||||||
"Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02"
|
"Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ImportPath": "github.com/golang/glog",
|
|
||||||
"Rev": "44145f04b68cf362d9c4df2182967c2275eaefed"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/golang/groupcache/lru",
|
"ImportPath": "github.com/golang/groupcache/lru",
|
||||||
"Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433"
|
"Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433"
|
||||||
@ -276,343 +272,347 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1",
|
"ImportPath": "k8s.io/api/apps/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1beta1",
|
"ImportPath": "k8s.io/api/apps/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1beta2",
|
"ImportPath": "k8s.io/api/apps/v1beta2",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/auditregistration/v1alpha1",
|
"ImportPath": "k8s.io/api/auditregistration/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authentication/v1",
|
"ImportPath": "k8s.io/api/authentication/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authorization/v1",
|
"ImportPath": "k8s.io/api/authorization/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v1",
|
"ImportPath": "k8s.io/api/autoscaling/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v2beta2",
|
"ImportPath": "k8s.io/api/autoscaling/v2beta2",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v1",
|
"ImportPath": "k8s.io/api/batch/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v1beta1",
|
"ImportPath": "k8s.io/api/batch/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/coordination/v1beta1",
|
"ImportPath": "k8s.io/api/coordination/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/core/v1",
|
"ImportPath": "k8s.io/api/core/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/events/v1beta1",
|
"ImportPath": "k8s.io/api/events/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
|
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/networking/v1",
|
"ImportPath": "k8s.io/api/networking/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/policy/v1beta1",
|
"ImportPath": "k8s.io/api/policy/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1",
|
"ImportPath": "k8s.io/api/rbac/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/scheduling/v1beta1",
|
"ImportPath": "k8s.io/api/scheduling/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1",
|
"ImportPath": "k8s.io/api/storage/v1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1beta1",
|
"ImportPath": "k8s.io/api/storage/v1beta1",
|
||||||
"Rev": "6560175f5b2dbcfe19dd4998f86dcb89a8f82627"
|
"Rev": "a33c8200050fc0751848276811abf3fc029b3133"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
||||||
"Rev": "90473842928c717082a393d6adceee99889fe8cc"
|
"Rev": "2a7c9300402896b3c073f2f47df85527c94f83a0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
"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",
|
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
||||||
"Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd"
|
"Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "sigs.k8s.io/yaml",
|
"ImportPath": "sigs.k8s.io/yaml",
|
||||||
|
@ -25,8 +25,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"github.com/googleapis/gnostic/OpenAPIv2"
|
"github.com/googleapis/gnostic/OpenAPIv2"
|
||||||
|
"k8s.io/klog"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@ -67,23 +67,23 @@ func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion stri
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
cachedResources := &metav1.APIResourceList{}
|
cachedResources := &metav1.APIResourceList{}
|
||||||
if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedResources); err == nil {
|
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
|
return cachedResources, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion)
|
liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion)
|
||||||
if err != nil {
|
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
|
return liveResources, err
|
||||||
}
|
}
|
||||||
if liveResources == nil || len(liveResources.APIResources) == 0 {
|
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
|
return liveResources, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := d.writeCachedFile(filename, liveResources); err != nil {
|
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
|
return liveResources, nil
|
||||||
@ -103,23 +103,23 @@ func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
cachedGroups := &metav1.APIGroupList{}
|
cachedGroups := &metav1.APIGroupList{}
|
||||||
if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedGroups); err == nil {
|
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
|
return cachedGroups, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
liveGroups, err := d.delegate.ServerGroups()
|
liveGroups, err := d.delegate.ServerGroups()
|
||||||
if err != nil {
|
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
|
return liveGroups, err
|
||||||
}
|
}
|
||||||
if liveGroups == nil || len(liveGroups.Groups) == 0 {
|
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
|
return liveGroups, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := d.writeCachedFile(filename, liveGroups); err != nil {
|
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
|
return liveGroups, nil
|
||||||
|
@ -20,10 +20,10 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"github.com/gregjones/httpcache"
|
"github.com/gregjones/httpcache"
|
||||||
"github.com/gregjones/httpcache/diskcache"
|
"github.com/gregjones/httpcache/diskcache"
|
||||||
"github.com/peterbourgon/diskv"
|
"github.com/peterbourgon/diskv"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type cacheRoundTripper struct {
|
type cacheRoundTripper struct {
|
||||||
@ -55,7 +55,7 @@ func (rt *cacheRoundTripper) CancelRequest(req *http.Request) {
|
|||||||
if cr, ok := rt.rt.Transport.(canceler); ok {
|
if cr, ok := rt.rt.Transport.(canceler); ok {
|
||||||
cr.CancelRequest(req)
|
cr.CancelRequest(req)
|
||||||
} else {
|
} else {
|
||||||
glog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport)
|
klog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/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 {
|
func (c *Controller) syncToStdout(key string) error {
|
||||||
obj, exists, err := c.indexer.GetByKey(key)
|
obj, exists, err := c.indexer.GetByKey(key)
|
||||||
if err != nil {
|
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
|
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.
|
// This controller retries 5 times if something goes wrong. After that, it stops trying.
|
||||||
if c.queue.NumRequeues(key) < 5 {
|
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
|
// 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.
|
// 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)
|
c.queue.Forget(key)
|
||||||
// Report to an external entity that, even after several retries, we could not successfully process this key
|
// Report to an external entity that, even after several retries, we could not successfully process this key
|
||||||
runtime.HandleError(err)
|
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{}) {
|
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
|
// Let the workers stop when we are done
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
glog.Info("Starting Pod controller")
|
klog.Info("Starting Pod controller")
|
||||||
|
|
||||||
go c.informer.Run(stopCh)
|
go c.informer.Run(stopCh)
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<-stopCh
|
<-stopCh
|
||||||
glog.Info("Stopping Pod controller")
|
klog.Info("Stopping Pod controller")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) runWorker() {
|
func (c *Controller) runWorker() {
|
||||||
@ -152,13 +152,13 @@ func main() {
|
|||||||
// creates the connection
|
// creates the connection
|
||||||
config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig)
|
config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatal(err)
|
klog.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// creates the clientset
|
// creates the clientset
|
||||||
clientset, err := kubernetes.NewForConfig(config)
|
clientset, err := kubernetes.NewForConfig(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatal(err)
|
klog.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the pod watcher
|
// create the pod watcher
|
||||||
|
@ -19,11 +19,11 @@ package v1beta1
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
policy "k8s.io/api/policy/v1beta1"
|
policy "k8s.io/api/policy/v1beta1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PodDisruptionBudgetListerExpansion allows custom methods to be added to
|
// PodDisruptionBudgetListerExpansion allows custom methods to be added to
|
||||||
@ -54,7 +54,7 @@ func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*
|
|||||||
pdb := list[i]
|
pdb := list[i]
|
||||||
selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector)
|
selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Warningf("invalid selector: %v", err)
|
klog.Warningf("invalid selector: %v", err)
|
||||||
// TODO(mml): add an event to the PDB
|
// TODO(mml): add an event to the PDB
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
"github.com/Azure/go-autorest/autorest"
|
"github.com/Azure/go-autorest/autorest"
|
||||||
"github.com/Azure/go-autorest/autorest/adal"
|
"github.com/Azure/go-autorest/autorest/adal"
|
||||||
"github.com/Azure/go-autorest/autorest/azure"
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/net"
|
"k8s.io/apimachinery/pkg/util/net"
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
@ -50,7 +50,7 @@ const (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if err := restclient.RegisterAuthProviderPlugin("azure", newAzureAuthProvider); err != nil {
|
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()
|
token, err := r.tokenSource.Token()
|
||||||
if err != nil {
|
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)
|
return nil, fmt.Errorf("acquiring a token for authorization header: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"golang.org/x/crypto/ssh/terminal"
|
"golang.org/x/crypto/ssh/terminal"
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@ -44,6 +43,7 @@ import (
|
|||||||
"k8s.io/client-go/tools/clientcmd/api"
|
"k8s.io/client-go/tools/clientcmd/api"
|
||||||
"k8s.io/client-go/transport"
|
"k8s.io/client-go/transport"
|
||||||
"k8s.io/client-go/util/connrotation"
|
"k8s.io/client-go/util/connrotation"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const execInfoEnv = "KUBERNETES_EXEC_INFO"
|
const execInfoEnv = "KUBERNETES_EXEC_INFO"
|
||||||
@ -228,7 +228,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||||||
Code: int32(res.StatusCode),
|
Code: int32(res.StatusCode),
|
||||||
}
|
}
|
||||||
if err := r.a.maybeRefreshCreds(creds, resp); err != nil {
|
if err := r.a.maybeRefreshCreds(creds, resp); err != nil {
|
||||||
glog.Errorf("refreshing credentials: %v", err)
|
klog.Errorf("refreshing credentials: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res, nil
|
return res, nil
|
||||||
|
@ -27,18 +27,18 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
"golang.org/x/oauth2/google"
|
"golang.org/x/oauth2/google"
|
||||||
"k8s.io/apimachinery/pkg/util/net"
|
"k8s.io/apimachinery/pkg/util/net"
|
||||||
"k8s.io/apimachinery/pkg/util/yaml"
|
"k8s.io/apimachinery/pkg/util/yaml"
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
"k8s.io/client-go/util/jsonpath"
|
"k8s.io/client-go/util/jsonpath"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if err := restclient.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil {
|
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)
|
cache := t.update(tok)
|
||||||
if t.persister != nil {
|
if t.persister != nil {
|
||||||
if err := t.persister.Persist(cache); err != 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
|
return tok, nil
|
||||||
@ -329,7 +329,7 @@ func (c *commandTokenSource) parseTokenCmdOutput(output []byte) (*oauth2.Token,
|
|||||||
}
|
}
|
||||||
var expiry time.Time
|
var expiry time.Time
|
||||||
if t, err := time.Parse(c.timeFmt, expiryStr); err != nil {
|
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 {
|
} else {
|
||||||
expiry = t
|
expiry = t
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
if res.StatusCode == 401 {
|
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)
|
t.persister.Persist(t.resetCache)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
"k8s.io/apimachinery/pkg/util/net"
|
"k8s.io/apimachinery/pkg/util/net"
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -49,7 +49,7 @@ const (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if err := restclient.RegisterAuthProviderPlugin("oidc", newOIDCAuthProvider); err != nil {
|
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 {
|
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)
|
cfgExtraScopes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"github.com/gophercloud/gophercloud"
|
"github.com/gophercloud/gophercloud"
|
||||||
"github.com/gophercloud/gophercloud/openstack"
|
"github.com/gophercloud/gophercloud/openstack"
|
||||||
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/net"
|
"k8s.io/apimachinery/pkg/util/net"
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if err := restclient.RegisterAuthProviderPlugin("openstack", newOpenstackAuthProvider); err != nil {
|
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
|
var err error
|
||||||
if t.authOpt == nil {
|
if t.authOpt == nil {
|
||||||
// reads the config from the environment
|
// 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()
|
options, err = openstack.AuthOptionsFromEnv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to read openstack env vars: %s", err)
|
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 {
|
if err == nil {
|
||||||
req.Header.Set("Authorization", "Bearer "+token)
|
req.Header.Set("Authorization", "Bearer "+token)
|
||||||
} else {
|
} 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)
|
return t.RoundTripper.RoundTrip(req)
|
||||||
@ -140,7 +140,7 @@ func newOpenstackAuthProvider(_ string, config map[string]string, persister rest
|
|||||||
var ttlDuration time.Duration
|
var ttlDuration time.Duration
|
||||||
var err error
|
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"]
|
ttl, found := config["ttl"]
|
||||||
if !found {
|
if !found {
|
||||||
ttlDuration = DefaultTTLDuration
|
ttlDuration = DefaultTTLDuration
|
||||||
|
@ -29,7 +29,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
@ -37,6 +36,7 @@ import (
|
|||||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
||||||
certutil "k8s.io/client-go/util/cert"
|
certutil "k8s.io/client-go/util/cert"
|
||||||
"k8s.io/client-go/util/flowcontrol"
|
"k8s.io/client-go/util/flowcontrol"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -331,7 +331,7 @@ func InClusterConfig() (*Config, error) {
|
|||||||
tlsClientConfig := TLSClientConfig{}
|
tlsClientConfig := TLSClientConfig{}
|
||||||
|
|
||||||
if _, err := certutil.NewPool(rootCAFile); err != nil {
|
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 {
|
} else {
|
||||||
tlsClientConfig.CAFile = rootCAFile
|
tlsClientConfig.CAFile = rootCAFile
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
||||||
)
|
)
|
||||||
@ -57,7 +57,7 @@ func RegisterAuthProviderPlugin(name string, plugin Factory) error {
|
|||||||
if _, found := plugins[name]; found {
|
if _, found := plugins[name]; found {
|
||||||
return fmt.Errorf("Auth Provider Plugin %q was registered twice", name)
|
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
|
plugins[name] = plugin
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -44,6 +43,7 @@ import (
|
|||||||
restclientwatch "k8s.io/client-go/rest/watch"
|
restclientwatch "k8s.io/client-go/rest/watch"
|
||||||
"k8s.io/client-go/tools/metrics"
|
"k8s.io/client-go/tools/metrics"
|
||||||
"k8s.io/client-go/util/flowcontrol"
|
"k8s.io/client-go/util/flowcontrol"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -114,7 +114,7 @@ type Request struct {
|
|||||||
// NewRequest creates a new request helper object for accessing runtime.Objects on a server.
|
// 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 {
|
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 {
|
if backoff == nil {
|
||||||
glog.V(2).Infof("Not implementing request backoff strategy.")
|
klog.V(2).Infof("Not implementing request backoff strategy.")
|
||||||
backoff = &NoBackoff{}
|
backoff = &NoBackoff{}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ func (r *Request) tryThrottle() {
|
|||||||
r.throttle.Accept()
|
r.throttle.Accept()
|
||||||
}
|
}
|
||||||
if latency := time.Since(now); latency > longThrottleLatency {
|
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 {
|
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
|
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 {
|
if seeker, ok := r.body.(io.Seeker); ok && r.body != nil {
|
||||||
_, err := seeker.Seek(0, 0)
|
_, err := seeker.Seek(0, 0)
|
||||||
if err != nil {
|
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)
|
fn(req, resp)
|
||||||
return true
|
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)
|
r.backoffMgr.Sleep(time.Duration(seconds) * time.Second)
|
||||||
return false
|
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
|
// 2. Apiserver sends back the headers and then part of the body
|
||||||
// 3. Apiserver closes connection.
|
// 3. Apiserver closes connection.
|
||||||
// 4. client-go should catch this and return an error.
|
// 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)
|
streamErr := fmt.Errorf("Stream error %#v when reading response body, may be caused by closed connection. Please retry.", err)
|
||||||
return Result{
|
return Result{
|
||||||
err: streamErr,
|
err: streamErr,
|
||||||
}
|
}
|
||||||
default:
|
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)
|
unexpectedErr := fmt.Errorf("Unexpected error %#v when reading response body. Please retry.", err)
|
||||||
return Result{
|
return Result{
|
||||||
err: unexpectedErr,
|
err: unexpectedErr,
|
||||||
@ -914,11 +914,11 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu
|
|||||||
func truncateBody(body string) string {
|
func truncateBody(body string) string {
|
||||||
max := 0
|
max := 0
|
||||||
switch {
|
switch {
|
||||||
case bool(glog.V(10)):
|
case bool(klog.V(10)):
|
||||||
return body
|
return body
|
||||||
case bool(glog.V(9)):
|
case bool(klog.V(9)):
|
||||||
max = 10240
|
max = 10240
|
||||||
case bool(glog.V(8)):
|
case bool(klog.V(8)):
|
||||||
max = 1024
|
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
|
// allocating a new string for the body output unless necessary. Uses a simple heuristic to determine
|
||||||
// whether the body is printable.
|
// whether the body is printable.
|
||||||
func glogBody(prefix string, body []byte) {
|
func glogBody(prefix string, body []byte) {
|
||||||
if glog.V(8) {
|
if klog.V(8) {
|
||||||
if bytes.IndexFunc(body, func(r rune) bool {
|
if bytes.IndexFunc(body, func(r rune) bool {
|
||||||
return r < 0x0a
|
return r < 0x0a
|
||||||
}) != -1 {
|
}) != -1 {
|
||||||
glog.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body)))
|
klog.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body)))
|
||||||
} else {
|
} 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"
|
// 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)
|
out, _, err := r.decoder.Decode(r.body, &schema.GroupVersionKind{Version: "v1"}, nil)
|
||||||
if err != 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
|
return r.err
|
||||||
}
|
}
|
||||||
switch t := out.(type) {
|
switch t := out.(type) {
|
||||||
|
@ -35,7 +35,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||||
@ -1855,6 +1855,10 @@ func buildString(length int) string {
|
|||||||
return string(s)
|
return string(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
klog.InitFlags(nil)
|
||||||
|
}
|
||||||
|
|
||||||
func TestTruncateBody(t *testing.T) {
|
func TestTruncateBody(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
body string
|
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 {
|
for _, test := range tests {
|
||||||
flag.Set("v", test.level)
|
flag.Set("v", test.level)
|
||||||
got := truncateBody(test.body)
|
got := truncateBody(test.body)
|
||||||
|
@ -24,8 +24,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TokenSourceWrapTransport returns a WrapTransport that injects bearer tokens
|
// TokenSourceWrapTransport returns a WrapTransport that injects bearer tokens
|
||||||
@ -131,7 +131,7 @@ func (ts *cachingTokenSource) Token() (*oauth2.Token, error) {
|
|||||||
if ts.tok == nil {
|
if ts.tok == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
glog.Errorf("Unable to rotate token: %v", err)
|
klog.Errorf("Unable to rotate token: %v", err)
|
||||||
return ts.tok, nil
|
return ts.tok, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/client-go/util/flowcontrol"
|
"k8s.io/client-go/util/flowcontrol"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Set of resp. Codes that we backoff for.
|
// 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
|
// 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.
|
// by tests which want to run 1000s of mock requests without slowing down.
|
||||||
func (b *URLBackoff) Disable() {
|
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)
|
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.
|
// in the future.
|
||||||
host, err := url.Parse(rawurl.String())
|
host, err := url.Parse(rawurl.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(4).Infof("Error extracting url: %v", rawurl)
|
klog.V(4).Infof("Error extracting url: %v", rawurl)
|
||||||
panic("bad url!")
|
panic("bad url!")
|
||||||
}
|
}
|
||||||
return host.Host
|
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())
|
b.Backoff.Next(b.baseUrlKey(actualUrl), b.Backoff.Clock.Now())
|
||||||
return
|
return
|
||||||
} else if responseCode >= 300 || err != nil {
|
} 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.
|
//If we got this far, there is no backoff required for this URL anymore.
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/client-go/discovery"
|
"k8s.io/client-go/discovery"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIGroupResources is an API group with a mapping of versions to
|
// 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
|
// Reset resets the internally cached Discovery information and will
|
||||||
// cause the next mapping request to re-discover.
|
// cause the next mapping request to re-discover.
|
||||||
func (d *DeferredDiscoveryRESTMapper) Reset() {
|
func (d *DeferredDiscoveryRESTMapper) Reset() {
|
||||||
glog.V(5).Info("Invalidating discovery information")
|
klog.V(5).Info("Invalidating discovery information")
|
||||||
|
|
||||||
d.initMu.Lock()
|
d.initMu.Lock()
|
||||||
defer d.initMu.Unlock()
|
defer d.initMu.Unlock()
|
||||||
|
@ -19,7 +19,7 @@ package restmapper
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
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.
|
// 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()
|
apiResList, err := e.discoveryClient.ServerResources()
|
||||||
if err != nil {
|
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 {
|
for _, apiResources := range apiResList {
|
||||||
gv, err := schema.ParseGroupVersion(apiResources.GroupVersion)
|
gv, err := schema.ParseGroupVersion(apiResources.GroupVersion)
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
for _, apiRes := range apiResources.APIResources {
|
for _, apiRes := range apiResources.APIResources {
|
||||||
|
10
tools/cache/delta_fifo.go
vendored
10
tools/cache/delta_fifo.go
vendored
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"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.
|
// 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)
|
deletedObj, exists, err := f.knownObjects.GetByKey(k)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
deletedObj = 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 {
|
} else if !exists {
|
||||||
deletedObj = nil
|
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++
|
queuedDeletions++
|
||||||
if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil {
|
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 {
|
func (f *DeltaFIFO) syncKeyLocked(key string) error {
|
||||||
obj, exists, err := f.knownObjects.GetByKey(key)
|
obj, exists, err := f.knownObjects.GetByKey(key)
|
||||||
if err != nil {
|
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
|
return nil
|
||||||
} else if !exists {
|
} 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
tools/cache/expiration_cache.go
vendored
4
tools/cache/expiration_cache.go
vendored
@ -20,8 +20,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"k8s.io/apimachinery/pkg/util/clock"
|
"k8s.io/apimachinery/pkg/util/clock"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExpirationCache implements the store interface
|
// ExpirationCache implements the store interface
|
||||||
@ -95,7 +95,7 @@ func (c *ExpirationCache) getOrExpire(key string) (interface{}, bool) {
|
|||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
if c.expirationPolicy.IsExpired(timestampedItem) {
|
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)
|
c.cacheStorage.Delete(key)
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
4
tools/cache/listers.go
vendored
4
tools/cache/listers.go
vendored
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package cache
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"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})
|
items, err := indexer.Index(NamespaceIndex, &metav1.ObjectMeta{Namespace: namespace})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Ignore error; do slow search without index.
|
// 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() {
|
for _, m := range indexer.List() {
|
||||||
metadata, err := meta.Accessor(m)
|
metadata, err := meta.Accessor(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
4
tools/cache/mutation_cache.go
vendored
4
tools/cache/mutation_cache.go
vendored
@ -22,7 +22,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@ -156,7 +156,7 @@ func (c *mutationCache) ByIndex(name string, indexKey string) ([]interface{}, er
|
|||||||
}
|
}
|
||||||
elements, err := fn(updated)
|
elements, err := fn(updated)
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
for _, inIndex := range elements {
|
for _, inIndex := range elements {
|
||||||
|
4
tools/cache/mutation_detector.go
vendored
4
tools/cache/mutation_detector.go
vendored
@ -24,7 +24,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/diff"
|
"k8s.io/apimachinery/pkg/util/diff"
|
||||||
@ -45,7 +45,7 @@ func NewCacheMutationDetector(name string) CacheMutationDetector {
|
|||||||
if !mutationDetectionEnabled {
|
if !mutationDetectionEnabled {
|
||||||
return dummyMutationDetector{}
|
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}
|
return &defaultCacheMutationDetector{name: name, period: 1 * time.Second}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
tools/cache/reflector.go
vendored
14
tools/cache/reflector.go
vendored
@ -31,7 +31,6 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
apierrs "k8s.io/apimachinery/pkg/api/errors"
|
apierrs "k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -41,6 +40,7 @@ import (
|
|||||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reflector watches a specified resource and causes all changes to be reflected in the given store.
|
// 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 starts a watch and handles watch events. Will restart the watch if it is closed.
|
||||||
// Run will exit when stopCh is closed.
|
// Run will exit when stopCh is closed.
|
||||||
func (r *Reflector) Run(stopCh <-chan struct{}) {
|
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() {
|
wait.Until(func() {
|
||||||
if err := r.ListAndWatch(stopCh); err != nil {
|
if err := r.ListAndWatch(stopCh); err != nil {
|
||||||
utilruntime.HandleError(err)
|
utilruntime.HandleError(err)
|
||||||
@ -166,7 +166,7 @@ func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) {
|
|||||||
// and then use the resource version to watch.
|
// and then use the resource version to watch.
|
||||||
// It returns error if ListAndWatch didn't even try to initialize watch.
|
// It returns error if ListAndWatch didn't even try to initialize watch.
|
||||||
func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
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
|
var resourceVersion string
|
||||||
|
|
||||||
// Explicitly set "0" as resource version - it's fine for the List()
|
// 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
|
return
|
||||||
}
|
}
|
||||||
if r.ShouldResync == nil || r.ShouldResync() {
|
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 {
|
if err := r.store.Resync(); err != nil {
|
||||||
resyncerrc <- err
|
resyncerrc <- err
|
||||||
return
|
return
|
||||||
@ -246,7 +246,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
|||||||
case io.EOF:
|
case io.EOF:
|
||||||
// watch closed normally
|
// watch closed normally
|
||||||
case io.ErrUnexpectedEOF:
|
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:
|
default:
|
||||||
utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.expectedType, err))
|
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 := r.watchHandler(w, &resourceVersion, resyncerrc, stopCh); err != nil {
|
||||||
if err != errorStopRequested {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ loop:
|
|||||||
r.metrics.numberOfShortWatches.Inc()
|
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)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
tools/cache/shared_informer.go
vendored
16
tools/cache/shared_informer.go
vendored
@ -28,7 +28,7 @@ import (
|
|||||||
"k8s.io/client-go/util/buffer"
|
"k8s.io/client-go/util/buffer"
|
||||||
"k8s.io/client-go/util/retry"
|
"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
|
// 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)
|
stopCh)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(2).Infof("stop requested")
|
klog.V(2).Infof("stop requested")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(4).Infof("caches populated")
|
klog.V(4).Infof("caches populated")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,11 +279,11 @@ func determineResyncPeriod(desired, check time.Duration) time.Duration {
|
|||||||
return desired
|
return desired
|
||||||
}
|
}
|
||||||
if check == 0 {
|
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
|
return 0
|
||||||
}
|
}
|
||||||
if desired < check {
|
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 check
|
||||||
}
|
}
|
||||||
return desired
|
return desired
|
||||||
@ -296,19 +296,19 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv
|
|||||||
defer s.startedLock.Unlock()
|
defer s.startedLock.Unlock()
|
||||||
|
|
||||||
if s.stopped {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if resyncPeriod > 0 {
|
if resyncPeriod > 0 {
|
||||||
if resyncPeriod < minimumResyncPeriod {
|
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
|
resyncPeriod = minimumResyncPeriod
|
||||||
}
|
}
|
||||||
|
|
||||||
if resyncPeriod < s.resyncCheckPeriod {
|
if resyncPeriod < s.resyncCheckPeriod {
|
||||||
if s.started {
|
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
|
resyncPeriod = s.resyncCheckPeriod
|
||||||
} else {
|
} else {
|
||||||
// if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update
|
// if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update
|
||||||
|
@ -24,8 +24,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"github.com/imdario/mergo"
|
"github.com/imdario/mergo"
|
||||||
|
"k8s.io/klog"
|
||||||
|
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
clientauth "k8s.io/client-go/tools/auth"
|
clientauth "k8s.io/client-go/tools/auth"
|
||||||
@ -545,12 +545,12 @@ func (config *inClusterClientConfig) Possible() bool {
|
|||||||
// to the default config.
|
// to the default config.
|
||||||
func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) {
|
func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) {
|
||||||
if kubeconfigPath == "" && masterUrl == "" {
|
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()
|
kubeconfig, err := restclient.InClusterConfig()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return kubeconfig, 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(
|
return NewNonInteractiveDeferredLoadingClientConfig(
|
||||||
&ClientConfigLoadingRules{ExplicitPath: kubeconfigPath},
|
&ClientConfigLoadingRules{ExplicitPath: kubeconfigPath},
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
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 {
|
func GetConfigFromFileOrDie(filename string) *clientcmdapi.Config {
|
||||||
config, err := getConfigFromFile(filename)
|
config, err := getConfigFromFile(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.FatalDepth(1, err)
|
klog.FatalDepth(1, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
@ -27,8 +27,8 @@ import (
|
|||||||
goruntime "runtime"
|
goruntime "runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"github.com/imdario/mergo"
|
"github.com/imdario/mergo"
|
||||||
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
@ -356,7 +356,7 @@ func LoadFromFile(filename string) (*clientcmdapi.Config, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// set LocationOfOrigin on every Cluster, User, and Context
|
||||||
for key, obj := range config.AuthInfos {
|
for key, obj := range config.AuthInfos {
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
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
|
// check for in-cluster configuration and use it
|
||||||
if config.icc.Possible() {
|
if config.icc.Possible() {
|
||||||
glog.V(4).Infof("Using in-cluster configuration")
|
klog.V(4).Infof("Using in-cluster configuration")
|
||||||
return config.icc.ClientConfig()
|
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.
|
// allow the namespace from the service account token directory to be used.
|
||||||
return config.icc.Namespace()
|
return config.icc.Namespace()
|
||||||
|
@ -60,7 +60,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
rl "k8s.io/client-go/tools/leaderelection/resourcelock"
|
rl "k8s.io/client-go/tools/leaderelection/resourcelock"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -184,16 +184,16 @@ func (le *LeaderElector) acquire(ctx context.Context) bool {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
succeeded := false
|
succeeded := false
|
||||||
desc := le.config.Lock.Describe()
|
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() {
|
wait.JitterUntil(func() {
|
||||||
succeeded = le.tryAcquireOrRenew()
|
succeeded = le.tryAcquireOrRenew()
|
||||||
le.maybeReportTransition()
|
le.maybeReportTransition()
|
||||||
if !succeeded {
|
if !succeeded {
|
||||||
glog.V(4).Infof("failed to acquire lease %v", desc)
|
klog.V(4).Infof("failed to acquire lease %v", desc)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
le.config.Lock.RecordEvent("became leader")
|
le.config.Lock.RecordEvent("became leader")
|
||||||
glog.Infof("successfully acquired lease %v", desc)
|
klog.Infof("successfully acquired lease %v", desc)
|
||||||
cancel()
|
cancel()
|
||||||
}, le.config.RetryPeriod, JitterFactor, true, ctx.Done())
|
}, le.config.RetryPeriod, JitterFactor, true, ctx.Done())
|
||||||
return succeeded
|
return succeeded
|
||||||
@ -224,11 +224,11 @@ func (le *LeaderElector) renew(ctx context.Context) {
|
|||||||
le.maybeReportTransition()
|
le.maybeReportTransition()
|
||||||
desc := le.config.Lock.Describe()
|
desc := le.config.Lock.Describe()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
glog.V(5).Infof("successfully renewed lease %v", desc)
|
klog.V(5).Infof("successfully renewed lease %v", desc)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
le.config.Lock.RecordEvent("stopped leading")
|
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()
|
cancel()
|
||||||
}, le.config.RetryPeriod, ctx.Done())
|
}, le.config.RetryPeriod, ctx.Done())
|
||||||
}
|
}
|
||||||
@ -249,11 +249,11 @@ func (le *LeaderElector) tryAcquireOrRenew() bool {
|
|||||||
oldLeaderElectionRecord, err := le.config.Lock.Get()
|
oldLeaderElectionRecord, err := le.config.Lock.Get()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !errors.IsNotFound(err) {
|
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
|
return false
|
||||||
}
|
}
|
||||||
if err = le.config.Lock.Create(leaderElectionRecord); err != nil {
|
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
|
return false
|
||||||
}
|
}
|
||||||
le.observedRecord = leaderElectionRecord
|
le.observedRecord = leaderElectionRecord
|
||||||
@ -268,7 +268,7 @@ func (le *LeaderElector) tryAcquireOrRenew() bool {
|
|||||||
}
|
}
|
||||||
if le.observedTime.Add(le.config.LeaseDuration).After(now.Time) &&
|
if le.observedTime.Add(le.config.LeaseDuration).After(now.Time) &&
|
||||||
!le.IsLeader() {
|
!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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ func (le *LeaderElector) tryAcquireOrRenew() bool {
|
|||||||
|
|
||||||
// update the lock itself
|
// update the lock itself
|
||||||
if err = le.config.Lock.Update(leaderElectionRecord); err != nil {
|
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
|
return false
|
||||||
}
|
}
|
||||||
le.observedRecord = leaderElectionRecord
|
le.observedRecord = leaderElectionRecord
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxTriesPerEvent = 12
|
const maxTriesPerEvent = 12
|
||||||
@ -144,7 +144,7 @@ func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrela
|
|||||||
}
|
}
|
||||||
tries++
|
tries++
|
||||||
if tries >= maxTriesPerEvent {
|
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
|
break
|
||||||
}
|
}
|
||||||
// Randomize the first sleep so that various clients won't all be
|
// 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) {
|
switch err.(type) {
|
||||||
case *restclient.RequestConstructionError:
|
case *restclient.RequestConstructionError:
|
||||||
// We will construct the request the same next time, so don't keep trying.
|
// 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
|
return true
|
||||||
case *errors.StatusError:
|
case *errors.StatusError:
|
||||||
if errors.IsAlreadyExists(err) {
|
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 {
|
} 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
|
return true
|
||||||
case *errors.UnexpectedObjectError:
|
case *errors.UnexpectedObjectError:
|
||||||
@ -209,7 +209,7 @@ func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEv
|
|||||||
default:
|
default:
|
||||||
// This case includes actual http transport errors. Go ahead and retry.
|
// 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
|
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) {
|
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)
|
ref, err := ref.GetReference(recorder.scheme, object)
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !validateEventType(eventtype) {
|
if !validateEventType(eventtype) {
|
||||||
glog.Errorf("Unsupported event type: '%v'", eventtype)
|
klog.Errorf("Unsupported event type: '%v'", eventtype)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/httpstream"
|
"k8s.io/apimachinery/pkg/util/httpstream"
|
||||||
"k8s.io/apimachinery/pkg/util/remotecommand"
|
"k8s.io/apimachinery/pkg/util/remotecommand"
|
||||||
@ -132,7 +132,7 @@ func (e *streamExecutor) Stream(options StreamOptions) error {
|
|||||||
case remotecommand.StreamProtocolV2Name:
|
case remotecommand.StreamProtocolV2Name:
|
||||||
streamer = newStreamProtocolV2(options)
|
streamer = newStreamProtocolV2(options)
|
||||||
case "":
|
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
|
fallthrough
|
||||||
case remotecommand.StreamProtocolV1Name:
|
case remotecommand.StreamProtocolV1Name:
|
||||||
streamer = newStreamProtocolV1(options)
|
streamer = newStreamProtocolV1(options)
|
||||||
|
@ -22,9 +22,9 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/httpstream"
|
"k8s.io/apimachinery/pkg/util/httpstream"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// streamProtocolV1 implements the first version of the streaming exec & attach
|
// 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)
|
errorChan := make(chan error)
|
||||||
|
|
||||||
cp := func(s string, dst io.Writer, src io.Reader) {
|
cp := func(s string, dst io.Writer, src io.Reader) {
|
||||||
glog.V(6).Infof("Copying %s", s)
|
klog.V(6).Infof("Copying %s", s)
|
||||||
defer glog.V(6).Infof("Done copying %s", s)
|
defer klog.V(6).Infof("Done copying %s", s)
|
||||||
if _, err := io.Copy(dst, src); err != nil && err != io.EOF {
|
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 {
|
if s == v1.StreamTypeStdout || s == v1.StreamTypeStderr {
|
||||||
doneChan <- struct{}{}
|
doneChan <- struct{}{}
|
||||||
|
@ -22,13 +22,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
"k8s.io/client-go/tools/cache"
|
"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,
|
// 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) {
|
func ContextWithOptionalTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) {
|
||||||
if timeout < 0 {
|
if timeout < 0 {
|
||||||
// This should be handled in validation
|
// 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
|
timeout = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
utilnet "k8s.io/apimachinery/pkg/util/net"
|
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.
|
// DebugWrappers wraps a round tripper and logs based on the current log level.
|
||||||
func DebugWrappers(rt http.RoundTripper) http.RoundTripper {
|
func DebugWrappers(rt http.RoundTripper) http.RoundTripper {
|
||||||
switch {
|
switch {
|
||||||
case bool(glog.V(9)):
|
case bool(klog.V(9)):
|
||||||
rt = newDebuggingRoundTripper(rt, debugCurlCommand, debugURLTiming, debugResponseHeaders)
|
rt = newDebuggingRoundTripper(rt, debugCurlCommand, debugURLTiming, debugResponseHeaders)
|
||||||
case bool(glog.V(8)):
|
case bool(klog.V(8)):
|
||||||
rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus, debugResponseHeaders)
|
rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus, debugResponseHeaders)
|
||||||
case bool(glog.V(7)):
|
case bool(klog.V(7)):
|
||||||
rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus)
|
rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus)
|
||||||
case bool(glog.V(6)):
|
case bool(klog.V(6)):
|
||||||
rt = newDebuggingRoundTripper(rt, debugURLTiming)
|
rt = newDebuggingRoundTripper(rt, debugURLTiming)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) {
|
|||||||
if canceler, ok := rt.rt.(requestCanceler); ok {
|
if canceler, ok := rt.rt.(requestCanceler); ok {
|
||||||
canceler.CancelRequest(req)
|
canceler.CancelRequest(req)
|
||||||
} else {
|
} 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 {
|
if canceler, ok := rt.rt.(requestCanceler); ok {
|
||||||
canceler.CancelRequest(req)
|
canceler.CancelRequest(req)
|
||||||
} else {
|
} 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 {
|
if canceler, ok := rt.rt.(requestCanceler); ok {
|
||||||
canceler.CancelRequest(req)
|
canceler.CancelRequest(req)
|
||||||
} else {
|
} 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 {
|
if canceler, ok := rt.delegate.(requestCanceler); ok {
|
||||||
canceler.CancelRequest(req)
|
canceler.CancelRequest(req)
|
||||||
} else {
|
} 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 {
|
if canceler, ok := rt.rt.(requestCanceler); ok {
|
||||||
canceler.CancelRequest(req)
|
canceler.CancelRequest(req)
|
||||||
} else {
|
} 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 {
|
if canceler, ok := rt.delegatedRoundTripper.(requestCanceler); ok {
|
||||||
canceler.CancelRequest(req)
|
canceler.CancelRequest(req)
|
||||||
} else {
|
} 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)
|
reqInfo := newRequestInfo(req)
|
||||||
|
|
||||||
if rt.levels[debugJustURL] {
|
if rt.levels[debugJustURL] {
|
||||||
glog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL)
|
klog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL)
|
||||||
}
|
}
|
||||||
if rt.levels[debugCurlCommand] {
|
if rt.levels[debugCurlCommand] {
|
||||||
glog.Infof("%s", reqInfo.toCurl())
|
klog.Infof("%s", reqInfo.toCurl())
|
||||||
|
|
||||||
}
|
}
|
||||||
if rt.levels[debugRequestHeaders] {
|
if rt.levels[debugRequestHeaders] {
|
||||||
glog.Infof("Request Headers:")
|
klog.Infof("Request Headers:")
|
||||||
for key, values := range reqInfo.RequestHeaders {
|
for key, values := range reqInfo.RequestHeaders {
|
||||||
for _, value := range values {
|
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)
|
reqInfo.complete(response, err)
|
||||||
|
|
||||||
if rt.levels[debugURLTiming] {
|
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] {
|
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] {
|
if rt.levels[debugResponseHeaders] {
|
||||||
glog.Infof("Response Headers:")
|
klog.Infof("Response Headers:")
|
||||||
for key, values := range reqInfo.ResponseHeaders {
|
for key, values := range reqInfo.ResponseHeaders {
|
||||||
for _, value := range values {
|
for _, value := range values {
|
||||||
glog.Infof(" %s: %s", key, value)
|
klog.Infof(" %s: %s", key, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
certificates "k8s.io/api/certificates/v1beta1"
|
certificates "k8s.io/api/certificates/v1beta1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"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
|
// signing API, so don't start the certificate manager if we don't have a
|
||||||
// client.
|
// client.
|
||||||
if m.certSigningRequestClient == nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(2).Infof("Certificate rotation is enabled.")
|
klog.V(2).Infof("Certificate rotation is enabled.")
|
||||||
|
|
||||||
templateChanged := make(chan struct{})
|
templateChanged := make(chan struct{})
|
||||||
go wait.Forever(func() {
|
go wait.Forever(func() {
|
||||||
deadline := m.nextRotationDeadline()
|
deadline := m.nextRotationDeadline()
|
||||||
if sleepInterval := deadline.Sub(time.Now()); sleepInterval > 0 {
|
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)
|
timer := time.NewTimer(sleepInterval)
|
||||||
defer timer.Stop()
|
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
|
// if the template now matches what we last requested, restart the rotation deadline loop
|
||||||
return
|
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 {
|
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))
|
utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err))
|
||||||
} else {
|
} 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
|
return &bootstrapCert, true, nil
|
||||||
@ -333,7 +333,7 @@ func getCurrentCertificateOrBootstrap(
|
|||||||
// This method also keeps track of "server health" by interpreting the responses it gets
|
// This method also keeps track of "server health" by interpreting the responses it gets
|
||||||
// from the server on the various calls it makes.
|
// from the server on the various calls it makes.
|
||||||
func (m *manager) rotateCerts() (bool, error) {
|
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()
|
template, csrPEM, keyPEM, privateKey, err := m.generateCSR()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -403,7 +403,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool {
|
|||||||
|
|
||||||
if template := m.getTemplate(); template != nil {
|
if template := m.getTemplate(); template != nil {
|
||||||
if template.Subject.CommonName != m.cert.Leaf.Subject.CommonName {
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool {
|
|||||||
desiredDNSNames := sets.NewString(template.DNSNames...)
|
desiredDNSNames := sets.NewString(template.DNSNames...)
|
||||||
missingDNSNames := desiredDNSNames.Difference(currentDNSNames)
|
missingDNSNames := desiredDNSNames.Difference(currentDNSNames)
|
||||||
if len(missingDNSNames) > 0 {
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool {
|
|||||||
}
|
}
|
||||||
missingIPs := desiredIPs.Difference(currentIPs)
|
missingIPs := desiredIPs.Difference(currentIPs)
|
||||||
if len(missingIPs) > 0 {
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +433,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool {
|
|||||||
desiredOrgs := sets.NewString(template.Subject.Organization...)
|
desiredOrgs := sets.NewString(template.Subject.Organization...)
|
||||||
missingOrgs := desiredOrgs.Difference(currentOrgs)
|
missingOrgs := desiredOrgs.Difference(currentOrgs)
|
||||||
if len(missingOrgs) > 0 {
|
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
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -468,7 +468,7 @@ func (m *manager) nextRotationDeadline() time.Time {
|
|||||||
totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore))
|
totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore))
|
||||||
deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration))
|
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 {
|
if m.certificateExpiration != nil {
|
||||||
m.certificateExpiration.Set(float64(notAfter.Unix()))
|
m.certificateExpiration.Set(float64(notAfter.Unix()))
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -127,7 +127,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) {
|
|||||||
if pairFileExists, err := fileExists(pairFile); err != nil {
|
if pairFileExists, err := fileExists(pairFile); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if pairFileExists {
|
} else if pairFileExists {
|
||||||
glog.Infof("Loading cert/key pair from %q.", pairFile)
|
klog.Infof("Loading cert/key pair from %q.", pairFile)
|
||||||
return loadFile(pairFile)
|
return loadFile(pairFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if certFileExists && keyFileExists {
|
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)
|
return loadX509KeyPair(s.certFile, s.keyFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if certFileExists && keyFileExists {
|
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)
|
return loadX509KeyPair(c, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"k8s.io/klog"
|
||||||
|
|
||||||
certificates "k8s.io/api/certificates/v1beta1"
|
certificates "k8s.io/api/certificates/v1beta1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
@ -104,7 +104,7 @@ func RequestCertificate(client certificatesclient.CertificateSigningRequestInter
|
|||||||
switch {
|
switch {
|
||||||
case err == nil:
|
case err == nil:
|
||||||
case errors.IsAlreadyExists(err) && len(name) > 0:
|
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{})
|
req, err = client.Get(name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, formatError("cannot retrieve certificate signing request: %v", err)
|
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 {
|
if err := ensureCompatible(req, csr, privateKey); err != nil {
|
||||||
return nil, fmt.Errorf("retrieved csr is not compatible: %v", err)
|
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:
|
default:
|
||||||
return nil, formatError("cannot create certificate signing request: %v", err)
|
return nil, formatError("cannot create certificate signing request: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user