mirror of https://github.com/portainer/portainer
parent
ff1f549590
commit
bb61723ba1
|
@ -1001,9 +1001,11 @@ class KubernetesCreateApplicationController {
|
|||
if (updatedService.Ingress && numberOfPortsInOldService && numberOfPortsInOldService <= updatedService.Ports.length) {
|
||||
const updatedOldPorts = updatedService.Ports.slice(0, numberOfPortsInOldService);
|
||||
const ingressesForService = fullIngresses.filter((ing) => {
|
||||
const ingServiceNames = ing.Paths.map((path) => path.ServiceName);
|
||||
if (ingServiceNames.includes(updatedService.Name)) {
|
||||
return true;
|
||||
if (ing.Paths) {
|
||||
const ingServiceNames = ing.Paths.map((path) => path.ServiceName);
|
||||
if (ingServiceNames.includes(updatedService.Name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
ingressesForService.forEach((ingressForService) => {
|
||||
|
|
|
@ -87,8 +87,16 @@ export function AppIngressPathForm({
|
|||
Host: newIngressHostValue,
|
||||
IngressName: newIngressNameValue,
|
||||
};
|
||||
// the selected option should match the new ingress path
|
||||
const newIngressOption = newIngressPath.Host
|
||||
? {
|
||||
ingressName: newIngressPath.IngressName,
|
||||
value: newIngressPath.Host ?? '',
|
||||
label: `${newIngressPath.Host} (${newIngressPath.IngressName})`,
|
||||
}
|
||||
: null;
|
||||
onChangeIngressPath(newIngressPath);
|
||||
setSelectedIngress(ingressHostOptionsWithCurrentValue[0] ?? null);
|
||||
setSelectedIngress(newIngressOption);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [ingressHostOptionsWithCurrentValue]);
|
||||
|
@ -129,7 +137,7 @@ export function AppIngressPathForm({
|
|||
{ingressHostOptions.length === 0 && !ingressPath?.Host && (
|
||||
<FormError>
|
||||
No ingress hostnames are available for the namespace '
|
||||
{namespace}'. Please update the namespace or{' '}
|
||||
{namespace}'. Please select another namespace or{' '}
|
||||
<Link
|
||||
to="kubernetes.ingresses.create"
|
||||
target="_blank"
|
||||
|
|
|
@ -229,7 +229,11 @@ export function kubeServicesValidation(
|
|||
'path-is-unique',
|
||||
'Ingress path is already in use for this hostname.',
|
||||
(path, context) => {
|
||||
if (path === undefined || validationData === undefined) {
|
||||
if (
|
||||
path === undefined ||
|
||||
validationData === undefined ||
|
||||
!context.parent.Host
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
const ingressHostAndPath = `${
|
||||
|
|
Loading…
Reference in New Issue