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:
1 parent
b7e5fb78d9
commit
69208fdfe6
1 file changed
+7
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user