apply changes from EE (#9232)

Co-authored-by: testa113 <testa113>
pull/9233/head
Ali 2023-07-20 13:48:48 +12:00 committed by GitHub
parent ff1f549590
commit bb61723ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 6 deletions

View File

@ -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) => {

View File

@ -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 &apos;
{namespace}&apos;. Please update the namespace or{' '}
{namespace}&apos;. Please select another namespace or{' '}
<Link
to="kubernetes.ingresses.create"
target="_blank"

View File

@ -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 = `${