Merge pull request #63010 from deads2k/api-04-metadataaccessor

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove confusing flexibility for metadata interpretation

Metadata accessors are coded in.  This means that we don't need to inject flexibility, the flexibility is already present based on what your code relies up.  This removes the per-individual resource injection which simplifies all calling code.

intersection of @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-cli-maintainers

```release-note
NONE
```

Kubernetes-commit: 6fbca94faec5d21630d076853e5f883b4a630412
This commit is contained in:
Kubernetes Publisher 2018-04-24 17:59:12 -07:00
commit d36be08adf
3 changed files with 93 additions and 92 deletions

164
Godeps/Godeps.json generated
View File

@ -244,331 +244,331 @@
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1", "ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1beta1", "ImportPath": "k8s.io/api/admissionregistration/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1", "ImportPath": "k8s.io/api/apps/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta1", "ImportPath": "k8s.io/api/apps/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta2", "ImportPath": "k8s.io/api/apps/v1beta2",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1", "ImportPath": "k8s.io/api/authentication/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1beta1", "ImportPath": "k8s.io/api/authentication/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1", "ImportPath": "k8s.io/api/authorization/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1beta1", "ImportPath": "k8s.io/api/authorization/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v1", "ImportPath": "k8s.io/api/autoscaling/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v2beta1", "ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1", "ImportPath": "k8s.io/api/batch/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1beta1", "ImportPath": "k8s.io/api/batch/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v2alpha1", "ImportPath": "k8s.io/api/batch/v2alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/certificates/v1beta1", "ImportPath": "k8s.io/api/certificates/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/core/v1", "ImportPath": "k8s.io/api/core/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/events/v1beta1", "ImportPath": "k8s.io/api/events/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/extensions/v1beta1", "ImportPath": "k8s.io/api/extensions/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1", "ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/networking/v1", "ImportPath": "k8s.io/api/networking/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/policy/v1beta1", "ImportPath": "k8s.io/api/policy/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1", "ImportPath": "k8s.io/api/rbac/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1alpha1", "ImportPath": "k8s.io/api/rbac/v1alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1beta1", "ImportPath": "k8s.io/api/rbac/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/scheduling/v1alpha1", "ImportPath": "k8s.io/api/scheduling/v1alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/settings/v1alpha1", "ImportPath": "k8s.io/api/settings/v1alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1", "ImportPath": "k8s.io/api/storage/v1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1alpha1", "ImportPath": "k8s.io/api/storage/v1alpha1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1beta1", "ImportPath": "k8s.io/api/storage/v1beta1",
"Rev": "1c973d529bdf4c4f349357ca665fb8e1d13e2d0d" "Rev": "6ef9db38b7d4d02a221e7af3e7f508ff19706fc6"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing", "ImportPath": "k8s.io/apimachinery/pkg/api/testing",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "73aa818bbacf185a03468ddc170fb275763dec3d" "Rev": "8cd82ca9c2ecc1799da600b08af6c04a112490aa"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "ImportPath": "k8s.io/kube-openapi/pkg/util/proto",

View File

@ -26,15 +26,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
// VersionInterfaces provides an object converter and metadata
// accessor appropriate for use with unstructured objects.
func VersionInterfaces(schema.GroupVersion) (*meta.VersionInterfaces, error) {
return &meta.VersionInterfaces{
ObjectConvertor: &unstructured.UnstructuredObjectConverter{},
MetadataAccessor: meta.NewAccessor(),
}, nil
}
// NewDiscoveryRESTMapper returns a RESTMapper based on discovery information. // NewDiscoveryRESTMapper returns a RESTMapper based on discovery information.
func NewDiscoveryRESTMapper(resources []*metav1.APIResourceList, versionFunc meta.VersionInterfacesFunc) (*meta.DefaultRESTMapper, error) { func NewDiscoveryRESTMapper(resources []*metav1.APIResourceList, versionFunc meta.VersionInterfacesFunc) (*meta.DefaultRESTMapper, error) {
rm := meta.NewDefaultRESTMapper(nil, versionFunc) rm := meta.NewDefaultRESTMapper(nil, versionFunc)

View File

@ -19,7 +19,9 @@ package dynamic
import ( import (
"testing" "testing"
"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/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
@ -43,7 +45,7 @@ func TestDiscoveryRESTMapper(t *testing.T) {
Kind: "test_kind", Kind: "test_kind",
} }
mapper, err := NewDiscoveryRESTMapper(resources, VersionInterfaces) mapper, err := NewDiscoveryRESTMapper(resources, versionInterfaces)
if err != nil { if err != nil {
t.Fatalf("unexpected error creating mapper: %s", err) t.Fatalf("unexpected error creating mapper: %s", err)
} }
@ -77,3 +79,11 @@ func TestDiscoveryRESTMapper(t *testing.T) {
} }
} }
} }
// VersionInterfaces provides an object converter and metadata
// accessor appropriate for use with unstructured objects.
func versionInterfaces(schema.GroupVersion) (*meta.VersionInterfaces, error) {
return &meta.VersionInterfaces{
ObjectConvertor: &unstructured.UnstructuredObjectConverter{},
}, nil
}