Remove api_resources duplicates

This commit is contained in:
Digital Studium 2024-04-13 21:41:59 +03:00
parent 7f49e12017
commit 610bdb6cfd
1 changed files with 1 additions and 1 deletions

2
kls
View File

@ -50,7 +50,7 @@ menu1 = Menu("Namespaces", namespaces, 0, curses.COLS // 5, SELECTED_WITHOUT_SEA
# рисуем второе меню # рисуем второе меню
## готовим контент ## готовим контент
api_resources_top = ["pods", "services", "deployments", "statefulsets", "ingresses", "configmaps", "secrets", "persistentvolumes", "nodes", "storageclasses"] api_resources_top = ["pods", "services", "deployments.apps", "statefulsets.apps", "ingresses", "configmaps", "secrets", "persistentvolumes", "persistentvolumeclaims", "nodes", "storageclasses"]
bytes_list = subprocess.check_output("kubectl api-resources -o name --verbs get", shell=True).split() bytes_list = subprocess.check_output("kubectl api-resources -o name --verbs get", shell=True).split()
api_resources_kubectl = [bytes_list[i].decode('utf-8') for i in range(len(bytes_list))] api_resources_kubectl = [bytes_list[i].decode('utf-8') for i in range(len(bytes_list))]
api_resources = api_resources_top + sorted(list(set(api_resources_kubectl) - set(api_resources_top))) api_resources = api_resources_top + sorted(list(set(api_resources_kubectl) - set(api_resources_top)))