1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

fix(configs): update unused badge logic [EE-6608] (#11500)

Co-authored-by: testa113 <testa113>
This commit is contained in:
Ali 2024-05-03 09:13:33 +12:00 committed by GitHub
parent 9b6779515e
commit 14a365045d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 590 additions and 113 deletions

View file

@ -1,4 +1,4 @@
import { Pod, PodList } from 'kubernetes-types/core/v1';
import { Pod } from 'kubernetes-types/core/v1';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
@ -7,37 +7,6 @@ import { parseKubernetesAxiosError } from '../axiosError';
import { ApplicationPatch } from './types';
export async function getNamespacePods(
environmentId: EnvironmentId,
namespace: string,
labelSelector?: string
) {
try {
const { data } = await axios.get<PodList>(
buildUrl(environmentId, namespace),
{
params: {
labelSelector,
},
}
);
const items = (data.items || []).map(
(pod) =>
<Pod>{
...pod,
kind: 'Pod',
apiVersion: data.apiVersion,
}
);
return items;
} catch (e) {
throw parseKubernetesAxiosError(
e,
`Unable to retrieve pods in namespace '${namespace}'`
);
}
}
export async function getPod<T extends Pod | string = Pod>(
environmentId: EnvironmentId,
namespace: string,