mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(ingress): update ingress tls after deletion EE-4387 (#7804)
* fix(ing): update tls value EE-4387
This commit is contained in:
parent
56087bcbb3
commit
c6ae8467c0
1 changed files with 23 additions and 7 deletions
|
@ -190,13 +190,16 @@ export function CreateIngressView() {
|
||||||
config.SecretType === 'kubernetes.io/tls' &&
|
config.SecretType === 'kubernetes.io/tls' &&
|
||||||
config.Namespace === namespace
|
config.Namespace === namespace
|
||||||
);
|
);
|
||||||
const tlsOptions: Option<string>[] = [
|
const tlsOptions: Option<string>[] = useMemo(
|
||||||
{ label: 'No TLS', value: '' },
|
() => [
|
||||||
...(matchedConfigs?.map((config) => ({
|
{ label: 'No TLS', value: '' },
|
||||||
label: config.Name,
|
...(matchedConfigs?.map((config) => ({
|
||||||
value: config.Name,
|
label: config.Name,
|
||||||
})) || []),
|
value: config.Name,
|
||||||
];
|
})) || []),
|
||||||
|
],
|
||||||
|
[matchedConfigs]
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
|
@ -226,6 +229,19 @@ export function CreateIngressView() {
|
||||||
params.namespace,
|
params.namespace,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// for each host, if the tls selection doesn't exist as an option, change it to the first option
|
||||||
|
if (ingressRule?.Hosts?.length) {
|
||||||
|
ingressRule.Hosts.forEach((host, hIndex) => {
|
||||||
|
const secret = host.Secret || '';
|
||||||
|
const tlsOptionVals = tlsOptions.map((o) => o.value);
|
||||||
|
if (tlsOptions?.length && !tlsOptionVals?.includes(secret)) {
|
||||||
|
handleTLSChange(hIndex, tlsOptionVals[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [tlsOptions, ingressRule.Hosts]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// for each path in each host, if the service port doesn't exist as an option, change it to the first option
|
// for each path in each host, if the service port doesn't exist as an option, change it to the first option
|
||||||
if (ingressRule?.Hosts?.length) {
|
if (ingressRule?.Hosts?.length) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue