Skip to content

Commit

Permalink
fix external dns certificates logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Nov 28, 2024
1 parent a281544 commit fb32416
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/external-dns-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,9 @@ export const ExternalDNSList = ({ externalDnsList, onItemClick }: Props) => {
{sortedExternalDnsList.map((externalDns) => {
const expanded = !!expandedRows[externalDns.fqdn];
const certificates = externalDns.tls.certificates ?? [];
const hasCertificates = certificates.length > 0;
const automationMessage = externalDns.tls.automation?.message;
const statusMessage = externalDns.tls.statusMessages;
const certificateExpiry = hasCertificates
? certificates[0].notAfter
: undefined;
const certificateExpiry = certificates[0]?.notAfter;

return (
<Fragment key={externalDns.fqdn}>
Expand All @@ -115,7 +112,9 @@ export const ExternalDNSList = ({ externalDnsList, onItemClick }: Props) => {
})}
>
<Table.Cell className="fitwidth padding-right-0">
{(hasCertificates || statusMessage || automationMessage) && (
{(certificates.length > 0 ||
statusMessage ||
automationMessage) && (
<Typography
link
as="span"
Expand Down Expand Up @@ -185,7 +184,7 @@ export const ExternalDNSList = ({ externalDnsList, onItemClick }: Props) => {
messages={statusMessage}
/>
)}
{certificates && (
{certificates.length > 0 && (
<TLSCertificateList tlsCertificates={certificates} />
)}
</div>
Expand Down

0 comments on commit fb32416

Please sign in to comment.