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 authored and GitHub committed 2020-12-08 16:08:28 +02:00
1 parent b7e5fb78d9
commit 69208fdfe6
1 file changed
+7 -2
+7 -2
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) {