Skip to content

Commit 13bc2aa

Browse files
authored
Merge pull request #241 from headlamp-k8s/cert-list-expire
cert-manager: Display Expires In field is Cert list view
2 parents d0e8353 + e90bb72 commit 13bc2aa

File tree

1 file changed

+16
-0
lines changed
  • cert-manager/src/components/certificates

1 file changed

+16
-0
lines changed

cert-manager/src/components/certificates/List.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ResourceListView } from '@kinvolk/headlamp-plugin/lib/CommonComponents';
2+
import { DateLabel } from '@kinvolk/headlamp-plugin/lib/components/common';
23
import { useCertManagerInstalled } from '../../hooks/useCertManagerInstalled';
34
import { Certificate } from '../../resources/certificate';
45
import { NotInstalledBanner } from '../common/CommonComponents';
@@ -23,6 +24,21 @@ export function CertificatesList() {
2324
label: 'Secret',
2425
getValue: item => item.spec.secretName,
2526
},
27+
{
28+
id: 'expiresIn',
29+
label: 'Expires In (Not After)',
30+
render: item => {
31+
return item?.status?.notAfter ? (
32+
<DateLabel date={item.status.notAfter} format="mini" />
33+
) : null;
34+
},
35+
getValue: item => item.status?.notAfter ?? '',
36+
sort: (a, b) => {
37+
const dateA = new Date(a.status?.notAfter);
38+
const dateB = new Date(b.status?.notAfter);
39+
return dateA.getTime() - dateB.getTime();
40+
},
41+
},
2642
'age',
2743
]}
2844
/>

0 commit comments

Comments
 (0)