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:
parent
85ae705833
commit
f7840e0407
17 changed files with 110 additions and 75 deletions
|
@ -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;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export interface Namespaces {
|
||||
[key: string]: {
|
||||
IsDefault: boolean;
|
||||
IsSystem: boolean;
|
||||
};
|
||||
[key: string]: DefaultOrSystemNamespace;
|
||||
}
|
||||
|
||||
export interface DefaultOrSystemNamespace {
|
||||
IsDefault: boolean;
|
||||
IsSystem: boolean;
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
export const systemNamespaces = [
|
||||
'kube-system',
|
||||
'kube-public',
|
||||
'kube-node-lease',
|
||||
'portainer',
|
||||
];
|
||||
|
||||
export function isSystemNamespace(namespace: string) {
|
||||
return systemNamespaces.includes(namespace || '');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue