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)
| 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: |
nothing calls this directly
no test coverage detected