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

Method ResourceFor

restmapper/discovery.go:255–266  ·  view source on GitHub ↗

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

(input schema.GroupVersionResource)

Source from the content-addressed store, hash-verified

253// ResourceFor takes a partial resource and returns back the single
254// match. It returns an error if there are multiple matches.
255func (d *DeferredDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (gvr schema.GroupVersionResource, err error) {
256 del, err := d.getDelegate()
257 if err != nil {
258 return schema.GroupVersionResource{}, err
259 }
260 gvr, err = del.ResourceFor(input)
261 if err != nil && !d.cl.Fresh() {
262 d.Reset()
263 gvr, err = d.ResourceFor(input)
264 }
265 return
266}
267
268// ResourcesFor takes a partial resource and returns back the list of
269// potential resource in priority order.

Callers

nothing calls this directly

Calls 4

getDelegateMethod · 0.95
ResetMethod · 0.95
ResourceForMethod · 0.65
FreshMethod · 0.65

Tested by

no test coverage detected