Skip to content

Commit

Permalink
Revert "Add check against invalid cluster session (#96)" (#101)
Browse files Browse the repository at this point in the history
This reverts commit 213aac2.
  • Loading branch information
bsquizz authored Aug 20, 2021
1 parent 10cb807 commit 712b9d4
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions bonfire/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
log = logging.getLogger(__name__)


def run_oc_status():
try:
oc("status", _silent=True)
return True
except ErrorReturnCode:
return False


# assume that the result of this will not change during execution of our app
@functools.lru_cache(maxsize=None, typed=False)
def get_api_resources():
Expand Down Expand Up @@ -685,14 +677,10 @@ def on_k8s():


def get_all_namespaces():

if run_oc_status():
if not on_k8s():
all_namespaces = get_json("project")["items"]
else:
all_namespaces = get_json("namespace")["items"]
if not on_k8s():
all_namespaces = get_json("project")["items"]
else:
raise ValueError("Error running oc status, check cluster login session")
all_namespaces = get_json("namespace")["items"]

return all_namespaces

Expand Down

0 comments on commit 712b9d4

Please sign in to comment.