Skip to content

Commit dc862ae

Browse files
Return the Kind of the object with the RESTMapper
1 parent 778a50d commit dc862ae

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/api/meta/interfaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type RESTMapping struct {
8383
// APIVersion represents the APIVersion that represents the resource as presented. It is provided
8484
// for convenience for passing around a consistent mapping.
8585
APIVersion string
86+
Kind string
8687

8788
runtime.Codec
8889
MetadataAccessor

pkg/api/meta/restmapper.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ func (m *DefaultRESTMapper) RESTMapping(version, kind string) (*RESTMapping, err
157157
}
158158

159159
return &RESTMapping{
160-
Resource: resource,
161-
APIVersion: version,
160+
Resource: resource,
161+
APIVersion: version,
162+
Kind: kind,
163+
162164
Codec: interfaces.Codec,
163165
MetadataAccessor: interfaces.MetadataAccessor,
164166
}, nil

0 commit comments

Comments
 (0)