From 0d83d6b6eece7a21a21676c66b2c22c7404b01be Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Mon, 14 Feb 2022 14:19:27 +0200 Subject: [PATCH] Make typing of HelmRepo shared Signed-off-by: Janne Savolainen --- src/common/helm-repo.ts | 16 ++++++++++++++++ src/main/helm/__mocks__/helm-chart-manager.ts | 2 +- src/main/helm/helm-chart-manager.ts | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/common/helm-repo.ts diff --git a/src/common/helm-repo.ts b/src/common/helm-repo.ts new file mode 100644 index 0000000000..9405d59bed --- /dev/null +++ b/src/common/helm-repo.ts @@ -0,0 +1,16 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type HelmRepo = { + name: string; + url: string; + cacheFilePath?: string; + caFile?: string; + certFile?: string; + insecureSkipTlsVerify?: boolean; + keyFile?: string; + username?: string; + password?: string; +}; diff --git a/src/main/helm/__mocks__/helm-chart-manager.ts b/src/main/helm/__mocks__/helm-chart-manager.ts index 858d6c24a4..7f950ebd65 100644 --- a/src/main/helm/__mocks__/helm-chart-manager.ts +++ b/src/main/helm/__mocks__/helm-chart-manager.ts @@ -4,7 +4,7 @@ */ import { sortCharts } from "../../../common/utils"; -import type { HelmRepo } from "../helm-repo-manager"; +import type { HelmRepo } from "../../../common/helm-repo"; const charts = new Map([ ["stable", { diff --git a/src/main/helm/helm-chart-manager.ts b/src/main/helm/helm-chart-manager.ts index 981c8602e8..3806be9557 100644 --- a/src/main/helm/helm-chart-manager.ts +++ b/src/main/helm/helm-chart-manager.ts @@ -5,13 +5,13 @@ import fs from "fs"; import * as yaml from "js-yaml"; -import type { HelmRepo } from "./helm-repo-manager"; import logger from "../logger"; import type { RepoHelmChartList } from "../../common/k8s-api/endpoints/helm-charts.api"; import { iter, put, sortCharts } from "../../common/utils"; import { execHelm } from "./exec"; import type { SetRequired } from "type-fest"; import { assert } from "console"; +import type { HelmRepo } from "../../common/helm-repo"; interface ChartCacheEntry { data: string; // serialized JSON