mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 21:39:40 +02:00
fix(app): fix app ingress edge cases [EE-5663] (#9150)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
8b11e1678e
commit
c752b98120
6 changed files with 44 additions and 10 deletions
|
@ -512,6 +512,17 @@ class KubernetesCreateApplicationController {
|
|||
/* #region SERVICES UI MANAGEMENT */
|
||||
onServicesChange(services) {
|
||||
return this.$async(async () => {
|
||||
// if the ingress isn't found in the currently loaded ingresses, then refresh the ingresses
|
||||
const ingressNamesUsed = services.flatMap((s) => s.Ports.flatMap((p) => (p.ingressPaths ? p.ingressPaths.flatMap((ip) => ip.IngressName || []) : [])));
|
||||
if (ingressNamesUsed.length) {
|
||||
const uniqueIngressNamesUsed = Array.from(new Set(ingressNamesUsed)); // get the unique ingress names used
|
||||
const ingressNamesLoaded = this.ingresses.map((i) => i.Name);
|
||||
const areAllIngressesLoaded = uniqueIngressNamesUsed.every((ingressNameUsed) => ingressNamesLoaded.includes(ingressNameUsed));
|
||||
if (!areAllIngressesLoaded) {
|
||||
this.refreshIngresses();
|
||||
}
|
||||
}
|
||||
// update the services
|
||||
this.formValues.Services = services;
|
||||
});
|
||||
}
|
||||
|
@ -1127,7 +1138,6 @@ class KubernetesCreateApplicationController {
|
|||
this.nodesLabels,
|
||||
this.ingresses
|
||||
);
|
||||
|
||||
this.originalServicePorts = structuredClone(this.formValues.Services.flatMap((service) => service.Ports));
|
||||
this.originalIngressPaths = structuredClone(this.originalServicePorts.flatMap((port) => port.ingressPaths).filter((ingressPath) => ingressPath.Host));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue