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

fix(k8s/app): populate ingress details [EE-2445] (#6463)

* fix(k8s/app): populate ingress details [EE-2445]

fix [EE-2445]

* fix(k8s/app): check if there are ingresses
This commit is contained in:
Chaim Lev-Ari 2022-01-27 08:37:46 +02:00 committed by GitHub
parent a9406764ee
commit 1fbf13e812
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 17 deletions

View file

@ -9,22 +9,34 @@ export default class KubeServicesItemViewController {
constructor(EndpointProvider, Authentication) {
this.EndpointProvider = EndpointProvider;
this.Authentication = Authentication;
this.KubernetesApplicationPublishingTypes = KubernetesApplicationPublishingTypes;
}
addPort() {
const p = new KubernetesServicePort();
p.nodePort = '';
p.port = '';
p.targetPort = '';
p.protocol = 'TCP';
const port = new KubernetesServicePort();
port.nodePort = '';
port.port = '';
port.targetPort = '';
port.protocol = 'TCP';
if (this.ingressType) {
const r = new KubernetesIngressServiceRoute();
r.ServiceName = this.serviceName;
p.ingress = r;
p.Ingress = true;
const route = new KubernetesIngressServiceRoute();
route.ServiceName = this.serviceName;
if (this.serviceType === KubernetesApplicationPublishingTypes.CLUSTER_IP && this.originalIngresses.length > 0) {
if (!route.IngressName) {
route.IngressName = this.originalIngresses[0].Name;
}
if (!route.Host) {
route.Host = this.originalIngresses[0].Hosts[0];
}
}
port.ingress = route;
port.Ingress = true;
}
this.servicePorts.push(p);
this.servicePorts.push(port);
}
removePort(index) {
@ -69,8 +81,6 @@ export default class KubeServicesItemViewController {
this.addPort();
}
this.KubernetesApplicationPublishingTypes = KubernetesApplicationPublishingTypes;
this.state = {
duplicates: {
targetPort: new KubernetesFormValidationReferences(),