mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
make RESTMapper.KindFor
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user