Switch API objects to not register per version codecs

Remove Codec from versionInterfaces in meta (RESTMapper is now agnostic
to codec and serialization). Register api/latest.Codecs as the codec
factory and use latest.Codecs.LegacyCodec(version) as an equvialent to
the previous codec.
This commit is contained in:
Clayton Coleman
2015-12-21 00:21:26 -05:00
parent 125ef6fbc8
commit c1d932e44a
54 changed files with 258 additions and 239 deletions

View File

@@ -75,7 +75,6 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error {
groupMeta := apimachinery.GroupMeta{
GroupVersion: preferredExternalVersion,
GroupVersions: externalVersions,
Codec: runtime.CodecFor(api.Scheme, preferredExternalVersion),
RESTMapper: newRESTMapper(externalVersions),
SelfLinker: runtime.SelfLinker(accessor),
InterfacesFor: interfacesFor,
@@ -119,7 +118,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e
switch version {
case v1beta1.SchemeGroupVersion:
return &meta.VersionInterfaces{
Codec: v1beta1.Codec,
ObjectConvertor: api.Scheme,
MetadataAccessor: accessor,
}, nil