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:
parent
b7e5fb78d9
commit
69208fdfe6
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user