|
1 | | -import { CoreV1Api, KubeConfig, User as k8sUser, V1ObjectReference } from '@kubernetes/client-node' |
| 1 | +import { CoreV1Api, User as k8sUser, KubeConfig, V1ObjectReference } from '@kubernetes/client-node' |
2 | 2 | import Debug from 'debug' |
3 | 3 |
|
4 | 4 | import { getRegions, ObjectStorageKeyRegions, Region, ResourcePage } from '@linode/api-v4' |
@@ -163,14 +163,7 @@ import { |
163 | 163 | userSecretDataToUser, |
164 | 164 | } from './utils/userUtils' |
165 | 165 | import { defineClusterId, ObjectStorageClient } from './utils/wizardUtils' |
166 | | -import { |
167 | | - fetchChartYaml, |
168 | | - fetchWorkloadCatalog, |
169 | | - isInteralGiteaURL, |
170 | | - NewHelmChartValues, |
171 | | - sparseCloneChart, |
172 | | - validateGitUrl, |
173 | | -} from './utils/workloadUtils' |
| 166 | +import { fetchWorkloadCatalog, isInteralGiteaURL, validateGitUrl } from './utils/workloadUtils' |
174 | 167 |
|
175 | 168 | interface ExcludedApp extends App { |
176 | 169 | managed: boolean |
@@ -1952,41 +1945,6 @@ export default class OtomiStack { |
1952 | 1945 | } |
1953 | 1946 | } |
1954 | 1947 |
|
1955 | | - async getHelmChartContent(url: string): Promise<any> { |
1956 | | - return await fetchChartYaml(url) |
1957 | | - } |
1958 | | - |
1959 | | - async createWorkloadCatalog(body: NewHelmChartValues): Promise<boolean> { |
1960 | | - const { gitRepositoryUrl, chartTargetDirName, chartIcon, allowTeams } = body |
1961 | | - |
1962 | | - const uuid = uuidv4() |
1963 | | - const localHelmChartsDir = `/tmp/otomi/charts/${uuid}` |
1964 | | - const helmChartCatalogUrl = env.HELM_CHART_CATALOG |
1965 | | - const { user, email } = this.git |
1966 | | - const { cluster } = await this.getSettings(['cluster']) |
1967 | | - |
1968 | | - try { |
1969 | | - await sparseCloneChart( |
1970 | | - gitRepositoryUrl, |
1971 | | - localHelmChartsDir, |
1972 | | - helmChartCatalogUrl, |
1973 | | - user, |
1974 | | - email, |
1975 | | - chartTargetDirName, |
1976 | | - chartIcon, |
1977 | | - allowTeams, |
1978 | | - cluster?.domainSuffix, |
1979 | | - ) |
1980 | | - return true |
1981 | | - } catch (error) { |
1982 | | - debug('Error adding new Helm chart to catalog') |
1983 | | - return false |
1984 | | - } finally { |
1985 | | - // Clean up: if the temporary directory exists, remove it. |
1986 | | - if (existsSync(localHelmChartsDir)) rmSync(localHelmChartsDir, { recursive: true, force: true }) |
1987 | | - } |
1988 | | - } |
1989 | | - |
1990 | 1948 | getTeamWorkloads(teamId: string): Workload[] { |
1991 | 1949 | return this.getTeamAplWorkloads(teamId).map( |
1992 | 1950 | (workload) => omit(getV1ObjectFromApl(workload), ['values']) as Workload, |
|
0 commit comments