You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/kubernetes/helpers/namespaceHelper.js

35 lines
1.0 KiB

import _ from 'lodash-es';
import { KUBERNETES_DEFAULT_SYSTEM_NAMESPACES } from 'Kubernetes/models/namespace/models';
import { isSystem } from 'Kubernetes/store/namespace';
import { isDefaultNamespace } from '@/react/kubernetes/namespaces/isDefaultNamespace';
export default class KubernetesNamespaceHelper {
/**
* Check if namespace is system or not
* @param {String} namespace Namespace (string name) to evaluate
* @returns Boolean
*/
static isSystemNamespace(namespace) {
return isSystem(namespace);
}
/**
* Check if namespace is default or not
* @param {String} namespace Namespace (string name) to evaluate
* @returns Boolean
*/
static isDefaultNamespace(namespace) {
return isDefaultNamespace(namespace);
}
/**
* Check if namespace is one of the default system namespaces
* @param {String} namespace Namespace (string name) to evaluate
* @returns Boolean
*/
static isDefaultSystemNamespace(namespace) {
return _.includes(KUBERNETES_DEFAULT_SYSTEM_NAMESPACES, namespace);
}
}