update RESTMapping API to be properly typed

This commit is contained in:
deads2k
2015-11-16 16:24:59 -05:00
parent 5c4fb5bcbe
commit 8679925847
17 changed files with 142 additions and 119 deletions

View File

@@ -51,13 +51,13 @@ type OutputVersionMapper struct {
}
// RESTMapping implements meta.RESTMapper by prepending the output version to the preferred version list.
func (m OutputVersionMapper) RESTMapping(kind string, versions ...string) (*meta.RESTMapping, error) {
mapping, err := m.RESTMapper.RESTMapping(kind, m.OutputVersion)
func (m OutputVersionMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error) {
mapping, err := m.RESTMapper.RESTMapping(gk, m.OutputVersion)
if err == nil {
return mapping, nil
}
return m.RESTMapper.RESTMapping(kind, versions...)
return m.RESTMapper.RESTMapping(gk, versions...)
}
// ShortcutExpander is a RESTMapper that can be used for Kubernetes