mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-27 15:39:39 +00:00
Merge pull request #70101 from imjching/68026-fix-golint-failures-discovery
Fix linting issues in staging/src/k8s.io/client-go/discovery/* Kubernetes-commit: 5e8e8dcff85b44e6c199762bca5716de25350630
This commit is contained in:
commit
d355f0b411
168
Godeps/Godeps.json
generated
168
Godeps/Godeps.json
generated
@ -280,339 +280,339 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1",
|
"ImportPath": "k8s.io/api/apps/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1beta1",
|
"ImportPath": "k8s.io/api/apps/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1beta2",
|
"ImportPath": "k8s.io/api/apps/v1beta2",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/auditregistration/v1alpha1",
|
"ImportPath": "k8s.io/api/auditregistration/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authentication/v1",
|
"ImportPath": "k8s.io/api/authentication/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authorization/v1",
|
"ImportPath": "k8s.io/api/authorization/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v1",
|
"ImportPath": "k8s.io/api/autoscaling/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v2beta2",
|
"ImportPath": "k8s.io/api/autoscaling/v2beta2",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v1",
|
"ImportPath": "k8s.io/api/batch/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v1beta1",
|
"ImportPath": "k8s.io/api/batch/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/coordination/v1beta1",
|
"ImportPath": "k8s.io/api/coordination/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/core/v1",
|
"ImportPath": "k8s.io/api/core/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/events/v1beta1",
|
"ImportPath": "k8s.io/api/events/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
|
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/networking/v1",
|
"ImportPath": "k8s.io/api/networking/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/policy/v1beta1",
|
"ImportPath": "k8s.io/api/policy/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1",
|
"ImportPath": "k8s.io/api/rbac/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/scheduling/v1beta1",
|
"ImportPath": "k8s.io/api/scheduling/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1",
|
"ImportPath": "k8s.io/api/storage/v1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1beta1",
|
"ImportPath": "k8s.io/api/storage/v1beta1",
|
||||||
"Rev": "843ad2d9b9ae703c74f2f43959e6ce0b24cc3185"
|
"Rev": "049920e654584910f24144786a75b837be5a84e6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
||||||
"Rev": "60666be32c5de527b69dabe8e4400b4f0aa897de"
|
"Rev": "fddbff74510a1159770789381aeaccd2effa2d4e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
||||||
|
@ -44,6 +44,7 @@ type memCacheClient struct {
|
|||||||
cacheValid bool
|
cacheValid bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Error Constants
|
||||||
var (
|
var (
|
||||||
ErrCacheEmpty = errors.New("the cache has not been filled yet")
|
ErrCacheEmpty = errors.New("the cache has not been filled yet")
|
||||||
ErrCacheNotFound = errors.New("not found")
|
ErrCacheNotFound = errors.New("not found")
|
||||||
|
@ -94,6 +94,8 @@ func (d *CachedDiscoveryClient) ServerResources() ([]*metav1.APIResourceList, er
|
|||||||
return ServerResources(d)
|
return ServerResources(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerGroups returns the supported groups, with information like supported versions and the
|
||||||
|
// preferred version.
|
||||||
func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
|
func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
|
||||||
filename := filepath.Join(d.cacheDirectory, "servergroups.json")
|
filename := filepath.Join(d.cacheDirectory, "servergroups.json")
|
||||||
cachedBytes, err := d.getCachedFile(filename)
|
cachedBytes, err := d.getCachedFile(filename)
|
||||||
@ -202,26 +204,36 @@ func (d *CachedDiscoveryClient) writeCachedFile(filename string, obj runtime.Obj
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RESTClient returns a RESTClient that is used to communicate with API server
|
||||||
|
// by this client implementation.
|
||||||
func (d *CachedDiscoveryClient) RESTClient() restclient.Interface {
|
func (d *CachedDiscoveryClient) RESTClient() restclient.Interface {
|
||||||
return d.delegate.RESTClient()
|
return d.delegate.RESTClient()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerPreferredResources returns the supported resources with the version preferred by the
|
||||||
|
// server.
|
||||||
func (d *CachedDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) {
|
func (d *CachedDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) {
|
||||||
return ServerPreferredResources(d)
|
return ServerPreferredResources(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerPreferredNamespacedResources returns the supported namespaced resources with the
|
||||||
|
// version preferred by the server.
|
||||||
func (d *CachedDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) {
|
func (d *CachedDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) {
|
||||||
return ServerPreferredNamespacedResources(d)
|
return ServerPreferredNamespacedResources(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerVersion retrieves and parses the server's version (git version).
|
||||||
func (d *CachedDiscoveryClient) ServerVersion() (*version.Info, error) {
|
func (d *CachedDiscoveryClient) ServerVersion() (*version.Info, error) {
|
||||||
return d.delegate.ServerVersion()
|
return d.delegate.ServerVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OpenAPISchema retrieves and parses the swagger API schema the server supports.
|
||||||
func (d *CachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {
|
func (d *CachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {
|
||||||
return d.delegate.OpenAPISchema()
|
return d.delegate.OpenAPISchema()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fresh is supposed to tell the caller whether or not to retry if the cache
|
||||||
|
// fails to find something (false = retry, true = no need to retry).
|
||||||
func (d *CachedDiscoveryClient) Fresh() bool {
|
func (d *CachedDiscoveryClient) Fresh() bool {
|
||||||
d.mutex.Lock()
|
d.mutex.Lock()
|
||||||
defer d.mutex.Unlock()
|
defer d.mutex.Unlock()
|
||||||
@ -229,6 +241,7 @@ func (d *CachedDiscoveryClient) Fresh() bool {
|
|||||||
return d.fresh
|
return d.fresh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Invalidate enforces that no cached data is used in the future that is older than the current time.
|
||||||
func (d *CachedDiscoveryClient) Invalidate() {
|
func (d *CachedDiscoveryClient) Invalidate() {
|
||||||
d.mutex.Lock()
|
d.mutex.Lock()
|
||||||
defer d.mutex.Unlock()
|
defer d.mutex.Unlock()
|
||||||
|
@ -263,8 +263,8 @@ func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList,
|
|||||||
|
|
||||||
result := []*metav1.APIResourceList{}
|
result := []*metav1.APIResourceList{}
|
||||||
grVersions := map[schema.GroupResource]string{} // selected version of a GroupResource
|
grVersions := map[schema.GroupResource]string{} // selected version of a GroupResource
|
||||||
grApiResources := map[schema.GroupResource]*metav1.APIResource{} // selected APIResource for a GroupResource
|
grAPIResources := map[schema.GroupResource]*metav1.APIResource{} // selected APIResource for a GroupResource
|
||||||
gvApiResourceLists := map[schema.GroupVersion]*metav1.APIResourceList{} // blueprint for a APIResourceList for later grouping
|
gvAPIResourceLists := map[schema.GroupVersion]*metav1.APIResourceList{} // blueprint for a APIResourceList for later grouping
|
||||||
|
|
||||||
for _, apiGroup := range serverGroupList.Groups {
|
for _, apiGroup := range serverGroupList.Groups {
|
||||||
for _, version := range apiGroup.Versions {
|
for _, version := range apiGroup.Versions {
|
||||||
@ -276,11 +276,11 @@ func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create empty list which is filled later in another loop
|
// create empty list which is filled later in another loop
|
||||||
emptyApiResourceList := metav1.APIResourceList{
|
emptyAPIResourceList := metav1.APIResourceList{
|
||||||
GroupVersion: version.GroupVersion,
|
GroupVersion: version.GroupVersion,
|
||||||
}
|
}
|
||||||
gvApiResourceLists[groupVersion] = &emptyApiResourceList
|
gvAPIResourceLists[groupVersion] = &emptyAPIResourceList
|
||||||
result = append(result, &emptyApiResourceList)
|
result = append(result, &emptyAPIResourceList)
|
||||||
|
|
||||||
for i := range apiResourceList.APIResources {
|
for i := range apiResourceList.APIResources {
|
||||||
apiResource := &apiResourceList.APIResources[i]
|
apiResource := &apiResourceList.APIResources[i]
|
||||||
@ -288,21 +288,21 @@ func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList,
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
gv := schema.GroupResource{Group: apiGroup.Name, Resource: apiResource.Name}
|
gv := schema.GroupResource{Group: apiGroup.Name, Resource: apiResource.Name}
|
||||||
if _, ok := grApiResources[gv]; ok && version.Version != apiGroup.PreferredVersion.Version {
|
if _, ok := grAPIResources[gv]; ok && version.Version != apiGroup.PreferredVersion.Version {
|
||||||
// only override with preferred version
|
// only override with preferred version
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
grVersions[gv] = version.Version
|
grVersions[gv] = version.Version
|
||||||
grApiResources[gv] = apiResource
|
grAPIResources[gv] = apiResource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// group selected APIResources according to GroupVersion into APIResourceLists
|
// group selected APIResources according to GroupVersion into APIResourceLists
|
||||||
for groupResource, apiResource := range grApiResources {
|
for groupResource, apiResource := range grAPIResources {
|
||||||
version := grVersions[groupResource]
|
version := grVersions[groupResource]
|
||||||
groupVersion := schema.GroupVersion{Group: groupResource.Group, Version: version}
|
groupVersion := schema.GroupVersion{Group: groupResource.Group, Version: version}
|
||||||
apiResourceList := gvApiResourceLists[groupVersion]
|
apiResourceList := gvAPIResourceLists[groupVersion]
|
||||||
apiResourceList.APIResources = append(apiResourceList.APIResources, *apiResource)
|
apiResourceList.APIResources = append(apiResourceList.APIResources, *apiResource)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,9 +464,9 @@ func NewDiscoveryClient(c restclient.Interface) *DiscoveryClient {
|
|||||||
|
|
||||||
// RESTClient returns a RESTClient that is used to communicate
|
// RESTClient returns a RESTClient that is used to communicate
|
||||||
// with API server by this client implementation.
|
// with API server by this client implementation.
|
||||||
func (c *DiscoveryClient) RESTClient() restclient.Interface {
|
func (d *DiscoveryClient) RESTClient() restclient.Interface {
|
||||||
if c == nil {
|
if d == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return c.restClient
|
return d.restClient
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,8 @@ type FakeDiscovery struct {
|
|||||||
FakedServerVersion *version.Info
|
FakedServerVersion *version.Info
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerResourcesForGroupVersion returns the supported resources for a group
|
||||||
|
// and version.
|
||||||
func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) {
|
func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) {
|
||||||
action := testing.ActionImpl{
|
action := testing.ActionImpl{
|
||||||
Verb: "get",
|
Verb: "get",
|
||||||
@ -50,6 +52,7 @@ func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*me
|
|||||||
return nil, fmt.Errorf("GroupVersion %q not found", groupVersion)
|
return nil, fmt.Errorf("GroupVersion %q not found", groupVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerResources returns the supported resources for all groups and versions.
|
||||||
func (c *FakeDiscovery) ServerResources() ([]*metav1.APIResourceList, error) {
|
func (c *FakeDiscovery) ServerResources() ([]*metav1.APIResourceList, error) {
|
||||||
action := testing.ActionImpl{
|
action := testing.ActionImpl{
|
||||||
Verb: "get",
|
Verb: "get",
|
||||||
@ -59,14 +62,20 @@ func (c *FakeDiscovery) ServerResources() ([]*metav1.APIResourceList, error) {
|
|||||||
return c.Resources, nil
|
return c.Resources, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerPreferredResources returns the supported resources with the version
|
||||||
|
// preferred by the server.
|
||||||
func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error) {
|
func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerPreferredNamespacedResources returns the supported namespaced resources
|
||||||
|
// with the version preferred by the server.
|
||||||
func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) {
|
func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerGroups returns the supported groups, with information like supported
|
||||||
|
// versions and the preferred version.
|
||||||
func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) {
|
func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) {
|
||||||
action := testing.ActionImpl{
|
action := testing.ActionImpl{
|
||||||
Verb: "get",
|
Verb: "get",
|
||||||
@ -108,6 +117,7 @@ func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ServerVersion retrieves and parses the server's version.
|
||||||
func (c *FakeDiscovery) ServerVersion() (*version.Info, error) {
|
func (c *FakeDiscovery) ServerVersion() (*version.Info, error) {
|
||||||
action := testing.ActionImpl{}
|
action := testing.ActionImpl{}
|
||||||
action.Verb = "get"
|
action.Verb = "get"
|
||||||
@ -122,10 +132,13 @@ func (c *FakeDiscovery) ServerVersion() (*version.Info, error) {
|
|||||||
return &versionInfo, nil
|
return &versionInfo, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OpenAPISchema retrieves and parses the swagger API schema the server supports.
|
||||||
func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error) {
|
func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error) {
|
||||||
return &openapi_v2.Document{}, nil
|
return &openapi_v2.Document{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RESTClient returns a RESTClient that is used to communicate with API server
|
||||||
|
// by this client implementation.
|
||||||
func (c *FakeDiscovery) RESTClient() restclient.Interface {
|
func (c *FakeDiscovery) RESTClient() restclient.Interface {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,11 @@ import (
|
|||||||
func MatchesServerVersion(clientVersion apimachineryversion.Info, client DiscoveryInterface) error {
|
func MatchesServerVersion(clientVersion apimachineryversion.Info, client DiscoveryInterface) error {
|
||||||
sVer, err := client.ServerVersion()
|
sVer, err := client.ServerVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("couldn't read version from server: %v\n", err)
|
return fmt.Errorf("couldn't read version from server: %v", err)
|
||||||
}
|
}
|
||||||
// GitVersion includes GitCommit and GitTreeState, but best to be safe?
|
// GitVersion includes GitCommit and GitTreeState, but best to be safe?
|
||||||
if clientVersion.GitVersion != sVer.GitVersion || clientVersion.GitCommit != sVer.GitCommit || clientVersion.GitTreeState != sVer.GitTreeState {
|
if clientVersion.GitVersion != sVer.GitVersion || clientVersion.GitCommit != sVer.GitCommit || clientVersion.GitTreeState != sVer.GitTreeState {
|
||||||
return fmt.Errorf("server version (%#v) differs from client version (%#v)!\n", sVer, clientVersion)
|
return fmt.Errorf("server version (%#v) differs from client version (%#v)", sVer, clientVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -101,12 +101,15 @@ func FilteredBy(pred ResourcePredicate, rls []*metav1.APIResourceList) []*metav1
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResourcePredicate has a method to check if a resource matches a given condition.
|
||||||
type ResourcePredicate interface {
|
type ResourcePredicate interface {
|
||||||
Match(groupVersion string, r *metav1.APIResource) bool
|
Match(groupVersion string, r *metav1.APIResource) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResourcePredicateFunc returns true if it matches a resource based on a custom condition.
|
||||||
type ResourcePredicateFunc func(groupVersion string, r *metav1.APIResource) bool
|
type ResourcePredicateFunc func(groupVersion string, r *metav1.APIResource) bool
|
||||||
|
|
||||||
|
// Match is a wrapper around ResourcePredicateFunc.
|
||||||
func (fn ResourcePredicateFunc) Match(groupVersion string, r *metav1.APIResource) bool {
|
func (fn ResourcePredicateFunc) Match(groupVersion string, r *metav1.APIResource) bool {
|
||||||
return fn(groupVersion, r)
|
return fn(groupVersion, r)
|
||||||
}
|
}
|
||||||
@ -116,6 +119,7 @@ type SupportsAllVerbs struct {
|
|||||||
Verbs []string
|
Verbs []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Match checks if a resource contains all the given verbs.
|
||||||
func (p SupportsAllVerbs) Match(groupVersion string, r *metav1.APIResource) bool {
|
func (p SupportsAllVerbs) Match(groupVersion string, r *metav1.APIResource) bool {
|
||||||
return sets.NewString([]string(r.Verbs)...).HasAll(p.Verbs...)
|
return sets.NewString([]string(r.Verbs)...).HasAll(p.Verbs...)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user