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:
parent
9b6779515e
commit
14a365045d
12 changed files with 590 additions and 113 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue