Change isEnabledForCluster to use KubernetesCluster instead of Cluster (#4584)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-12-17 08:28:47 -05:00
1 parent 3418c0acfe
commit bde0a9ef91
6 files changed
+74 -20

No files matched your search

+6 -3
View File
@@ -20,13 +20,13 @@
*/
import type * as registries from "./registries";
import type { Cluster } from "../main/cluster";
import { Disposers, LensExtension } from "./lens-extension";
import { getExtensionPageUrl } from "./registries/page-registry";
import type { CatalogEntity } from "../common/catalog";
import type { Disposer } from "../common/utils";
import { catalogEntityRegistry, EntityFilter } from "../renderer/api/catalog-entity-registry";
import { catalogCategoryRegistry, CategoryFilter } from "../renderer/api/catalog-category-registry";
import type { KubernetesCluster } from "../common/catalog-entities";
export class LensRendererExtension extends LensExtension {
globalPages: registries.PageRegistration[] = [];
@@ -57,9 +57,12 @@ export class LensRendererExtension extends LensExtension {
}
/**
* Defines if extension is enabled for a given cluster. Defaults to `true`.
* Defines if extension is enabled for a given cluster. This method is only
* called when the extension is created within a cluster frame.
*
* The default implementation is to return `true`
*/
async isEnabledForCluster(cluster: Cluster): Promise<Boolean> {
async isEnabledForCluster(cluster: KubernetesCluster): Promise<Boolean> {
return (void cluster) || true;
}