mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
feat(k8s/resource-pool): prevent admins from making changes to "system" namespaces (#4167)
This commit is contained in:
parent
d85708f6ea
commit
b8f8c75380
2 changed files with 13 additions and 6 deletions
|
@ -18,7 +18,8 @@ class KubernetesResourcePoolController {
|
|||
KubernetesResourcePoolService,
|
||||
KubernetesEventService,
|
||||
KubernetesPodService,
|
||||
KubernetesApplicationService
|
||||
KubernetesApplicationService,
|
||||
KubernetesNamespaceHelper
|
||||
) {
|
||||
this.$async = $async;
|
||||
this.$state = $state;
|
||||
|
@ -32,6 +33,7 @@ class KubernetesResourcePoolController {
|
|||
this.KubernetesEventService = KubernetesEventService;
|
||||
this.KubernetesPodService = KubernetesPodService;
|
||||
this.KubernetesApplicationService = KubernetesApplicationService;
|
||||
this.KubernetesNamespaceHelper = KubernetesNamespaceHelper;
|
||||
|
||||
this.onInit = this.onInit.bind(this);
|
||||
this.createResourceQuotaAsync = this.createResourceQuotaAsync.bind(this);
|
||||
|
@ -206,6 +208,11 @@ class KubernetesResourcePoolController {
|
|||
this.state.memoryUsed = KubernetesResourceReservationHelper.megaBytesValue(quota.MemoryLimitUsed);
|
||||
}
|
||||
|
||||
this.isEditable = !this.KubernetesNamespaceHelper.isSystemNamespace(this.pool.Namespace.Name);
|
||||
if (this.pool.Namespace.Name === 'default') {
|
||||
this.isEditable = false;
|
||||
}
|
||||
|
||||
await this.getEvents();
|
||||
await this.getApplications();
|
||||
} catch (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue