mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
19 lines
618 B
TypeScript
19 lines
618 B
TypeScript
import { KubeObject, KubeObjectStatus } from "../renderer-api/k8s-api";
|
|
import { BaseRegistry } from "./base-registry";
|
|
|
|
export interface KubeObjectStatusRegistration {
|
|
kind: string;
|
|
apiVersions: string[];
|
|
resolve: (object: KubeObject) => KubeObjectStatus;
|
|
}
|
|
|
|
export class KubeObjectStatusRegistry extends BaseRegistry<KubeObjectStatusRegistration> {
|
|
getItemsForKind(kind: string, apiVersion: string) {
|
|
return this.getItems().filter((item) => {
|
|
return item.kind === kind && item.apiVersions.includes(apiVersion);
|
|
});
|
|
}
|
|
}
|
|
|
|
export const kubeObjectStatusRegistry = new KubeObjectStatusRegistry();
|