MCPcopy Index your code
hub / github.com/kubernetes-client/python / search

Method search

kubernetes/base/dynamic/discovery.py:340–355  ·  view source on GitHub ↗

Takes keyword arguments and returns matching resources. The search will happen in the following order: prefix: The api prefix for a resource, ie, /api, /oapi, /apis. Can usually be ignored group: The api group of a resource. Will also be extracted from ap

(self, **kwargs)

Source from the content-addressed store, hash-verified

338
339
340 def search(self, **kwargs):
341 """ Takes keyword arguments and returns matching resources. The search
342 will happen in the following order:
343 prefix: The api prefix for a resource, ie, /api, /oapi, /apis. Can usually be ignored
344 group: The api group of a resource. Will also be extracted from api_version if it is present there
345 api_version: The api version of a resource
346 kind: The kind of the resource
347 arbitrary arguments (see below), in random order
348
349 The arbitrary arguments can be any valid attribute for an Resource object
350 """
351 results = self.__search(self.__build_search(**kwargs), self.__resources)
352 if not results:
353 self.invalidate_cache()
354 results = self.__search(self.__build_search(**kwargs), self.__resources)
355 return results
356
357 def __build_search(self, prefix=None, group=None, api_version=None, kind=None, **kwargs):
358 if not group and api_version and '/' in api_version:

Callers

nothing calls this directly

Calls 3

__searchMethod · 0.95
__build_searchMethod · 0.95
invalidate_cacheMethod · 0.80

Tested by

no test coverage detected