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 committed by GitHub
parent b7e5fb78d9
commit 69208fdfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {