mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(app): add ingress to app service form [EE-5569] (#9106)
This commit is contained in:
parent
8c16fbb8aa
commit
89c1d0e337
47 changed files with 1929 additions and 1181 deletions
|
@ -307,22 +307,18 @@ class KubernetesApplicationHelper {
|
|||
svcport.protocol = port.protocol;
|
||||
svcport.targetPort = port.targetPort;
|
||||
svcport.serviceName = service.metadata.name;
|
||||
svcport.ingress = {};
|
||||
svcport.ingressPaths = [];
|
||||
|
||||
app.Ingresses.value.forEach((ingress) => {
|
||||
const ingressNameMatched = ingress.Paths.find((ingPath) => ingPath.ServiceName === service.metadata.name);
|
||||
const ingressPortMatched = ingress.Paths.find((ingPath) => ingPath.Port === port.port);
|
||||
// only add ingress info to the port if the ingress serviceport matches the port in the service
|
||||
if (ingressPortMatched) {
|
||||
svcport.ingress = {
|
||||
IngressName: ingressPortMatched.IngressName,
|
||||
Host: ingressPortMatched.Host,
|
||||
Path: ingressPortMatched.Path,
|
||||
};
|
||||
}
|
||||
if (ingressNameMatched) {
|
||||
svc.Ingress = true;
|
||||
}
|
||||
const matchingIngressPaths = ingress.Paths.filter((ingPath) => ingPath.ServiceName === service.metadata.name && ingPath.Port === port.port);
|
||||
// only add ingress info to the port if the ingress serviceport and name matches
|
||||
const newPaths = matchingIngressPaths.map((ingPath) => ({
|
||||
IngressName: ingPath.IngressName,
|
||||
Host: ingPath.Host,
|
||||
Path: ingPath.Path,
|
||||
}));
|
||||
svcport.ingressPaths = [...svcport.ingressPaths, ...newPaths];
|
||||
svc.Ingress = matchingIngressPaths.length > 0;
|
||||
});
|
||||
|
||||
ports.push(svcport);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue