mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
parent
ff1f549590
commit
bb61723ba1
3 changed files with 20 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue