-
Notifications
You must be signed in to change notification settings - Fork 1
fix: remove createworkloadcatalog endpoint #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { CoreV1Api, KubeConfig, User as k8sUser, V1ObjectReference } from '@kubernetes/client-node' | ||
| import { CoreV1Api, User as k8sUser, KubeConfig, V1ObjectReference } from '@kubernetes/client-node' | ||
| import Debug from 'debug' | ||
|
|
||
| import { getRegions, ObjectStorageKeyRegions, Region, ResourcePage } from '@linode/api-v4' | ||
|
|
@@ -99,6 +99,8 @@ import { | |
| EDITOR_INACTIVITY_TIMEOUT, | ||
| GIT_BRANCH, | ||
| GIT_EMAIL, | ||
| GIT_INIT_MAX_RETRIES, | ||
| GIT_INIT_RETRY_INTERVAL_MS, | ||
| GIT_LOCAL_PATH, | ||
| GIT_PASSWORD, | ||
| GIT_REPO_URL, | ||
|
|
@@ -111,8 +113,6 @@ import { | |
| PREINSTALLED_EXCLUDED_APPS, | ||
| TOOLS_HOST, | ||
| VERSIONS, | ||
| GIT_INIT_MAX_RETRIES, | ||
| GIT_INIT_RETRY_INTERVAL_MS, | ||
| } from 'src/validators' | ||
| import { v4 as uuidv4 } from 'uuid' | ||
| import { parse as parseYaml, stringify as stringifyYaml } from 'yaml' | ||
|
|
@@ -163,14 +163,7 @@ import { | |
| userSecretDataToUser, | ||
| } from './utils/userUtils' | ||
| import { defineClusterId, ObjectStorageClient } from './utils/wizardUtils' | ||
| import { | ||
| fetchChartYaml, | ||
| fetchWorkloadCatalog, | ||
| isInteralGiteaURL, | ||
| NewHelmChartValues, | ||
| sparseCloneChart, | ||
| validateGitUrl, | ||
| } from './utils/workloadUtils' | ||
| import { fetchChartYaml, fetchWorkloadCatalog, isInteralGiteaURL, validateGitUrl } from './utils/workloadUtils' | ||
|
|
||
| interface ExcludedApp extends App { | ||
| managed: boolean | ||
|
|
@@ -2015,37 +2008,6 @@ export default class OtomiStack { | |
| return await fetchChartYaml(url) | ||
| } | ||
|
|
||
| async createWorkloadCatalog(body: NewHelmChartValues): Promise<boolean> { | ||
| const { gitRepositoryUrl, chartTargetDirName, chartIcon, allowTeams } = body | ||
|
|
||
| const uuid = uuidv4() | ||
| const localHelmChartsDir = `/tmp/otomi/charts/${uuid}` | ||
| const helmChartCatalogUrl = env.HELM_CHART_CATALOG | ||
| const { user, email } = this.git | ||
| const { cluster } = await this.getSettings(['cluster']) | ||
|
|
||
| try { | ||
| await sparseCloneChart( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The |
||
| gitRepositoryUrl, | ||
| localHelmChartsDir, | ||
| helmChartCatalogUrl, | ||
| user, | ||
| email, | ||
| chartTargetDirName, | ||
| chartIcon, | ||
| allowTeams, | ||
| cluster?.domainSuffix, | ||
| ) | ||
| return true | ||
| } catch (error) { | ||
| debug('Error adding new Helm chart to catalog') | ||
| return false | ||
| } finally { | ||
| // Clean up: if the temporary directory exists, remove it. | ||
| if (existsSync(localHelmChartsDir)) rmSync(localHelmChartsDir, { recursive: true, force: true }) | ||
| } | ||
| } | ||
|
|
||
| getTeamWorkloads(teamId: string): Workload[] { | ||
| return this.getTeamAplWorkloads(teamId).map( | ||
| (workload) => omit(getV1ObjectFromApl(workload), ['values']) as Workload, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
NewHelmChartValuesinterface is no longer used and should be removed.