From a95a81e7ac5ed4824be5eb38d735d1eaf76ab95b Mon Sep 17 00:00:00 2001 From: Brandon Squizzato Date: Thu, 3 Jun 2021 10:24:59 -0400 Subject: [PATCH] Use 'kind' instead of 'name' for api resource lookup --- bonfire/openshift.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bonfire/openshift.py b/bonfire/openshift.py index 330af0c6..71411bfa 100644 --- a/bonfire/openshift.py +++ b/bonfire/openshift.py @@ -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():