From 4fffc86e7e61adaa897309d3f207b00851e142e5 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Thu, 3 Dec 2020 13:38:37 +0200 Subject: [PATCH] performance fix when cluster has lots of namespaces Signed-off-by: Jari Kolehmainen --- src/main/cluster.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/cluster.ts b/src/main/cluster.ts index 421856dc03..a130691e8e 100644 --- a/src/main/cluster.ts +++ b/src/main/cluster.ts @@ -425,17 +425,8 @@ export class Cluster implements ClusterModel, ClusterState { try { const namespaceList = await api.listNamespace(); - const nsAccessStatuses = await Promise.all( - namespaceList.body.items.map(ns => this.canI({ - namespace: ns.metadata.name, - resource: "pods", - verb: "list", - })) - ); - return namespaceList.body.items - .filter((ns, i) => nsAccessStatuses[i]) - .map(ns => ns.metadata.name); + return namespaceList.body.items.map(ns => ns.metadata.name); } catch (error) { const ctx = this.getProxyKubeconfig().getContextObject(this.contextName);