mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve how kubernetes cluster status is resolved (#2909)
This commit is contained in:
1 parent
0ad44d6f40
commit
39149eedfd
4 files changed
+36
-6
No files matched your search
@@ -48,6 +48,15 @@ export class CatalogEntityRegistry {
|
||||
return allItems.filter((entity) => this.categoryRegistry.getCategoryForEntity(entity) !== undefined);
|
||||
}
|
||||
|
||||
getById<T extends CatalogEntity>(id: string): T | undefined {
|
||||
const item = this.items.find((entity) => entity.metadata.uid === id);
|
||||
|
||||
if (item) return item as T;
|
||||
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getItemsForApiKind<T extends CatalogEntity>(apiVersion: string, kind: string): T[] {
|
||||
const items = this.items.filter((item) => item.apiVersion === apiVersion && item.kind === kind);
|
||||
|
||||
|
||||
Reference in new issue
Block a user