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 47d41f8338
3 changed files with 252 additions and 257 deletions

494
Godeps/Godeps.json generated

File diff suppressed because it is too large Load Diff

View File

@ -146,23 +146,19 @@ func interfacesFor(version schema.GroupVersion) (*meta.VersionInterfaces, error)
switch version {
case testGroupVersion:
return &meta.VersionInterfaces{
ObjectConvertor: scheme,
MetadataAccessor: accessor,
ObjectConvertor: scheme,
}, nil
case newGroupVersion:
return &meta.VersionInterfaces{
ObjectConvertor: scheme,
MetadataAccessor: accessor,
ObjectConvertor: scheme,
}, nil
case grouplessGroupVersion:
return &meta.VersionInterfaces{
ObjectConvertor: scheme,
MetadataAccessor: accessor,
ObjectConvertor: scheme,
}, nil
case testGroup2Version:
return &meta.VersionInterfaces{
ObjectConvertor: scheme,
MetadataAccessor: accessor,
ObjectConvertor: scheme,
}, nil
default:
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, groupVersions)

View File

@ -155,8 +155,7 @@ func TestInstallAPIGroups(t *testing.T) {
interfacesFor := func(version schema.GroupVersion) (*meta.VersionInterfaces, error) {
return &meta.VersionInterfaces{
ObjectConvertor: scheme,
MetadataAccessor: meta.NewAccessor(),
ObjectConvertor: scheme,
}, nil
}