Change get all behaviour
This commit is contained in:
parent
5165fa2aca
commit
7c21965500
5
kls
5
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
|
||||
|
|
Loading…
Reference in New Issue