mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
feat(helm): uninstall helm app from details view [r8s-285] (#648)
This commit is contained in:
parent
6fcf1893d3
commit
bbe94f55b6
5 changed files with 133 additions and 18 deletions
|
@ -7,6 +7,7 @@ import { getAllSettledItems } from '@/portainer/helpers/promise-utils';
|
|||
import { withGlobalError } from '@/react-tools/react-query';
|
||||
import { notifyError, notifySuccess } from '@/portainer/services/notifications';
|
||||
import { pluralize } from '@/portainer/helpers/strings';
|
||||
import { uninstallHelmApplication } from '@/react/kubernetes/helm/HelmApplicationView/queries/useUninstallHelmAppMutation';
|
||||
|
||||
import { parseKubernetesAxiosError } from '../../axiosError';
|
||||
import { ApplicationRowData } from '../ListView/ApplicationsDatatable/types';
|
||||
|
@ -225,7 +226,11 @@ async function deleteApplication(
|
|||
await deletePodApplication(application, stacks, environmentId);
|
||||
break;
|
||||
case 'Helm':
|
||||
await uninstallHelmApplication(application, environmentId);
|
||||
await uninstallHelmApplication(
|
||||
environmentId,
|
||||
application.Name,
|
||||
application.ResourcePool
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
|
@ -266,21 +271,6 @@ async function deletePodApplication(
|
|||
}
|
||||
}
|
||||
|
||||
async function uninstallHelmApplication(
|
||||
application: ApplicationRowData,
|
||||
environmentId: EnvironmentId
|
||||
) {
|
||||
try {
|
||||
await axios.delete(
|
||||
`/endpoints/${environmentId}/kubernetes/helm/${application.Name}`,
|
||||
{ params: { namespace: application.ResourcePool } }
|
||||
);
|
||||
} catch (error) {
|
||||
// parseAxiosError, because it's a regular portainer api error
|
||||
throw parseAxiosError(error, 'Unable to remove application');
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteHorizontalPodAutoscaler(
|
||||
hpa: HorizontalPodAutoscaler,
|
||||
environmentId: EnvironmentId
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue