make RESTMapper.KindFor

This commit is contained in:
deads2k
2015-11-16 15:14:27 -05:00
parent 581a1ad1af
commit 5c4fb5bcbe
11 changed files with 41 additions and 69 deletions

View File

@@ -49,11 +49,11 @@ type exists struct {
}
func (e *exists) Admit(a admission.Attributes) (err error) {
defaultVersion, kind, err := api.RESTMapper.VersionAndKindForResource(a.GetResource())
gvk, err := api.RESTMapper.KindFor(a.GetResource())
if err != nil {
return errors.NewInternalError(err)
}
mapping, err := api.RESTMapper.RESTMapping(kind, defaultVersion)
mapping, err := api.RESTMapper.RESTMapping(gvk.Kind, gvk.GroupVersion().String())
if err != nil {
return errors.NewInternalError(err)
}