1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 04:15:28 +02:00

feat(kubernetes): Prevent deployment/edition of resources inside a system namespace (#4039)

* feat(kubernetes): Prevent deployment/edition of resources inside a system namespace

* feat(kubernetes): minor UI update

Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
Maxime Bajeux 2020-07-14 07:39:13 +02:00 committed by GitHub
parent 181a6f4553
commit 8b79f2524d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions

View file

@ -37,7 +37,8 @@ class KubernetesCreateApplicationController {
KubernetesStackService,
KubernetesConfigurationService,
KubernetesNodeService,
KubernetesPersistentVolumeClaimService
KubernetesPersistentVolumeClaimService,
KubernetesNamespaceHelper
) {
this.$async = $async;
this.$state = $state;
@ -51,6 +52,7 @@ class KubernetesCreateApplicationController {
this.KubernetesConfigurationService = KubernetesConfigurationService;
this.KubernetesNodeService = KubernetesNodeService;
this.KubernetesPersistentVolumeClaimService = KubernetesPersistentVolumeClaimService;
this.KubernetesNamespaceHelper = KubernetesNamespaceHelper;
this.ApplicationDeploymentTypes = KubernetesApplicationDeploymentTypes;
this.ApplicationDataAccessPolicies = KubernetesApplicationDataAccessPolicies;
@ -592,7 +594,8 @@ class KubernetesCreateApplicationController {
const [resourcePools, nodes] = await Promise.all([this.KubernetesResourcePoolService.get(), this.KubernetesNodeService.get()]);
this.resourcePools = resourcePools;
this.resourcePools = _.filter(resourcePools, (resourcePool) => !this.KubernetesNamespaceHelper.isSystemNamespace(resourcePool.Namespace.Name));
this.formValues.ResourcePool = this.resourcePools[0];
_.forEach(nodes, (item) => {