1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Query all objects using single api call if admin and namespace list is not overridden (#1692)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-12-08 16:08:28 +02:00
parent 2c25e1ee13
commit 36031d222f

View File

@ -91,9 +91,14 @@ export abstract class KubeObjectStore<T extends KubeObject = any> extends ItemSt
let items: T[];
try {
const { allowedNamespaces } = getHostedCluster();
const { allowedNamespaces, accessibleNamespaces, isAdmin } = getHostedCluster();
if (isAdmin && accessibleNamespaces.length == 0) {
items = await this.loadItems();
} else {
items = await this.loadItems(allowedNamespaces);
}
items = await this.loadItems(allowedNamespaces);
items = this.filterItemsOnLoad(items);
} finally {
if (items) {