MCPcopy
hub / github.com/kubernetes/client-go / KindFor

Method KindFor

restmapper/discovery.go:225–236  ·  view source on GitHub ↗

KindFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.

(resource schema.GroupVersionResource)

Source from the content-addressed store, hash-verified

223// KindFor takes a partial resource and returns back the single match.
224// It returns an error if there are multiple matches.
225func (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.

Calls 3

getDelegateMethod · 0.95
ResetMethod · 0.95
FreshMethod · 0.65