Skip to content

Commit

Permalink
Use 'kind' instead of 'name' for api resource lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz committed Jun 3, 2021
1 parent 668898f commit a95a81e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bonfire/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,20 @@ class StatusError(Exception):
]


def _is_checkable(kind):
return kind.lower() in _CHECKABLE_RESOURCES


def _available_checkable_resources(namespaced=False):
"""Returns resources we are able to parse status of that are present on the cluster."""
if namespaced:
return [
r["name"]
r["kind"].lower()
for r in get_api_resources()
if r["name"] in _CHECKABLE_RESOURCES and r["namespaced"]
if _is_checkable(r["kind"]) and r["namespaced"]
]

return [r["name"] for r in get_api_resources() if r["name"] in _CHECKABLE_RESOURCES]
return [r["kind"].lower() for r in get_api_resources() if _is_checkable(r["kind"])]


def _resources_for_ns_wait():
Expand Down

0 comments on commit a95a81e

Please sign in to comment.