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

fix(ui): mark resources system correctly [EE-6558] (#10996)

* fix(ui): mark resources system correctly [EE-6558]

* address review comments
This commit is contained in:
Prabhat Khera 2024-01-23 13:49:25 +13:00 committed by GitHub
parent 85ae705833
commit f7840e0407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 110 additions and 75 deletions

View file

@ -4,7 +4,7 @@ import axios, { parseAxiosError } from '@/portainer/services/axios';
import { notifyError } from '@/portainer/services/notifications';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Namespaces } from '../types';
import { DefaultOrSystemNamespace } from '../types';
export function useNamespaceQuery(
environmentId: EnvironmentId,
@ -27,7 +27,7 @@ export async function getNamespace(
namespace: string
) {
try {
const { data: ns } = await axios.get<Namespaces>(
const { data: ns } = await axios.get<DefaultOrSystemNamespace>(
`kubernetes/${environmentId}/namespaces/${namespace}`
);
return ns;

View file

@ -1,6 +1,8 @@
export interface Namespaces {
[key: string]: {
IsDefault: boolean;
IsSystem: boolean;
};
[key: string]: DefaultOrSystemNamespace;
}
export interface DefaultOrSystemNamespace {
IsDefault: boolean;
IsSystem: boolean;
}

View file

@ -1,10 +0,0 @@
export const systemNamespaces = [
'kube-system',
'kube-public',
'kube-node-lease',
'portainer',
];
export function isSystemNamespace(namespace: string) {
return systemNamespaces.includes(namespace || '');
}