KindFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.
(resource schema.GroupVersionResource)
| 223 | // KindFor takes a partial resource and returns back the single match. |
| 224 | // It returns an error if there are multiple matches. |
| 225 | func (d *DeferredDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (gvk schema.GroupVersionKind, err error) { |
| 226 | del, err := d.getDelegate() |
| 227 | if err != nil { |
| 228 | return schema.GroupVersionKind{}, err |
| 229 | } |
| 230 | gvk, err = del.KindFor(resource) |
| 231 | if err != nil && !d.cl.Fresh() { |
| 232 | d.Reset() |
| 233 | gvk, err = d.KindFor(resource) |
| 234 | } |
| 235 | return |
| 236 | } |
| 237 | |
| 238 | // KindsFor takes a partial resource and returns back the list of |
| 239 | // potential kinds in priority order. |