1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00

fix(k8s/ns): validate ingress ctrl host pattern (#5663)

* fix(k8s/ns): validate ingress ctrl host pattern

* feat(kube/ns): validate ingress hostname
This commit is contained in:
Chaim Lev-Ari 2021-09-24 14:02:06 +03:00 committed by GitHub
parent 7d40a83d03
commit db04bc9f38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -34,7 +34,7 @@ class KubernetesCreateResourcePoolController {
onChangeIngressHostname() {
const state = this.state.duplicates.ingressHosts;
const hosts = _.flatMap(this.formValues.IngressClasses, 'Hosts');
const hostnames = _.map(hosts, 'Host');
const hostnames = _.compact(hosts.map((h) => h.Host));
const hostnamesWithoutRemoved = _.filter(hostnames, (h) => !h.NeedsDeletion);
const allHosts = _.flatMap(this.allIngresses, 'Hosts');
const formDuplicates = KubernetesFormValidationHelper.getDuplicates(hostnamesWithoutRemoved);