diff --git a/src/main/helm/helm-chart-manager.ts b/src/main/helm/helm-chart-manager.ts index eb375bc3d9..cf6832a91a 100644 --- a/src/main/helm/helm-chart-manager.ts +++ b/src/main/helm/helm-chart-manager.ts @@ -6,10 +6,10 @@ import { promiseExec } from "../promise-exec"; import { helmCli } from "./helm-cli"; import { HelmChart } from "../../renderer/api/endpoints/helm-charts.api"; -type HelmGroups = { [key: string]: HelmChart[] }; +export type HelmChartGroups = { [key: string]: HelmChart[] }; type CachedYaml = { - entries: HelmGroups + entries: HelmChartGroups }; export class HelmChartManager { @@ -27,7 +27,7 @@ export class HelmChartManager { return charts[name]; } - public async charts(): Promise { + public async charts(): Promise { try { const cachedYaml = await this.cachedYaml(); diff --git a/src/main/helm/helm-service.ts b/src/main/helm/helm-service.ts index 2fb54a5847..c92a864acd 100644 --- a/src/main/helm/helm-service.ts +++ b/src/main/helm/helm-service.ts @@ -5,6 +5,8 @@ import { HelmChartManager } from "./helm-chart-manager"; import { releaseManager } from "./helm-release-manager"; import { HelmChart } from "../../renderer/api/endpoints/helm-charts.api"; +import type { HelmChartGroups } from "./helm-chart-manager"; + class HelmService { public async installChart(cluster: Cluster, data: { chart: string; values: {}; name: string; namespace: string; version: string }) { return await releaseManager.installChart(data.chart, data.values, data.name, data.namespace, data.version, cluster.getProxyKubeconfigPath()); @@ -19,7 +21,7 @@ class HelmService { for (const repo of repositories) { charts[repo.name] = {}; const manager = new HelmChartManager(repo); - const { groups } = new HelmChartGroups(await manager.charts()); + const { groups } = new ChartGroups(await manager.charts()); charts[repo.name] = groups; } @@ -93,11 +95,11 @@ class HelmService { } } -class HelmChartGroups { - items: Map; +class ChartGroups { + private items: Map; - constructor(group: { [chartName: string]: HelmChart[] }) { - this.items = new Map(Object.entries(group)); + constructor(groups: HelmChartGroups) { + this.items = new Map(Object.entries(groups)); this.excludeDeprecatedGroups(); }