From 7c21965500c90c7b755e68bf01d309b9e393b52c Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Wed, 8 May 2024 09:01:41 +0300 Subject: [PATCH] Change get all behaviour --- kls | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kls b/kls index aeca621..7537a31 100755 --- a/kls +++ b/kls @@ -78,7 +78,10 @@ def refresh_third_menu(namespace: str, api_resource: str): menu = menus[2] menu.rows = [] if api_resource and namespace: - menu.rows = kubectl(f"-n {namespace} get {api_resource} --no-headers --ignore-not-found") + if api_resource == "all": + menu.rows = kubectl(f"api-resources --verbs=get --namespaced -o name | grep -v events | xargs -n 1 kubectl get --show-kind --namespace {namespace} --ignore-not-found --no-headers -o name") + else: + menu.rows = kubectl(f"-n {namespace} get {api_resource} --no-headers --ignore-not-found") index_before_update = menu.filtered_rows.index menu.filtered_rows = CircularList([x for x in menu.rows if menu.filter in x]) # update filtered rows menu.filtered_rows.index = index_before_update @@ -184,7 +187,7 @@ def handle_horizontal_navigation(key, menu): def catch_input(menu: Menu): - while True: # refresh third menu until key pressed + while True: # refresh third menu until key pressed try: key = SCREEN.getkey() break