mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Change isEnabledForCluster to use KubernetesCluster instead of Cluster (#4584)
This commit is contained in:
1 parent
3418c0acfe
commit
bde0a9ef91
6 files changed
+74
-20
No files matched your search
@@ -25,10 +25,10 @@ import { isEqual } from "lodash";
|
||||
import { action, computed, makeObservable, observable, observe, reaction, when } from "mobx";
|
||||
import path from "path";
|
||||
import { AppPaths } from "../../common/app-paths";
|
||||
import { ClusterStore } from "../../common/cluster-store";
|
||||
import { broadcastMessage, ipcMainOn, ipcRendererOn, requestMain, ipcMainHandle } from "../../common/ipc";
|
||||
import { Disposer, getHostedClusterId, toJS } from "../../common/utils";
|
||||
import { Disposer, toJS } from "../../common/utils";
|
||||
import logger from "../../main/logger";
|
||||
import type { KubernetesCluster } from "../common-api/catalog";
|
||||
import type { InstalledExtension } from "../extension-discovery";
|
||||
import { ExtensionsStore } from "../extensions-store";
|
||||
import type { LensExtension, LensExtensionConstructor, LensExtensionId } from "../lens-extension";
|
||||
@@ -280,12 +280,11 @@ export class ExtensionLoader {
|
||||
});
|
||||
}
|
||||
|
||||
loadOnClusterRenderer() {
|
||||
loadOnClusterRenderer(entity: KubernetesCluster) {
|
||||
logger.debug(`${logModule}: load on cluster renderer (dashboard)`);
|
||||
const cluster = ClusterStore.getInstance().getById(getHostedClusterId());
|
||||
|
||||
this.autoInitExtensions(async (extension: LensRendererExtension) => {
|
||||
if ((await extension.isEnabledForCluster(cluster)) === false) {
|
||||
if ((await extension.isEnabledForCluster(entity)) === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user