From dc862ae46307070daa4edfa689f35d0ab2a7b910 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 2 Nov 2014 09:21:25 -0500 Subject: [PATCH] Return the Kind of the object with the RESTMapper --- pkg/api/meta/interfaces.go | 1 + pkg/api/meta/restmapper.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/api/meta/interfaces.go b/pkg/api/meta/interfaces.go index cfc0a4cfa97..f3494abfecd 100644 --- a/pkg/api/meta/interfaces.go +++ b/pkg/api/meta/interfaces.go @@ -83,6 +83,7 @@ type RESTMapping struct { // APIVersion represents the APIVersion that represents the resource as presented. It is provided // for convenience for passing around a consistent mapping. APIVersion string + Kind string runtime.Codec MetadataAccessor diff --git a/pkg/api/meta/restmapper.go b/pkg/api/meta/restmapper.go index 11541b61ecf..92d1278555a 100644 --- a/pkg/api/meta/restmapper.go +++ b/pkg/api/meta/restmapper.go @@ -157,8 +157,10 @@ func (m *DefaultRESTMapper) RESTMapping(version, kind string) (*RESTMapping, err } return &RESTMapping{ - Resource: resource, - APIVersion: version, + Resource: resource, + APIVersion: version, + Kind: kind, + Codec: interfaces.Codec, MetadataAccessor: interfaces.MetadataAccessor, }, nil