@@ -254,6 +254,7 @@ <h5 class="modal-title">Resource</h5>
254254 <option value="e2e_test_failed">e2e Test Failed</option>
255255 <option value="e2e_test_flaked">e2e Test Flaked</option>
256256 <option value="interesting_events">Interesting Events</option>
257+ <option value="certificate_rotation">Certificate Rotation</option>
257258 </select>
258259`
259260
@@ -296,6 +297,7 @@ <h5 class="modal-title">Resource</h5>
296297 eventInterval . categories . e2e_test_flaked = isE2EFlaked ( eventInterval ) ;
297298 eventInterval . categories . e2e_test_passed = isE2EPassed ( eventInterval ) ;
298299 eventInterval . categories . endpoint_availability = isEndpointConnectivity ( eventInterval ) ;
300+ eventInterval . categories . certificate_rotation = isCertificateRotation ( eventInterval ) ;
299301 eventInterval . categories . uncategorized = ! _ . some ( eventInterval . categories ) ; // will save time later during filtering and re-rendering since we don't render any uncategorized events
300302 } ) ;
301303
@@ -438,6 +440,52 @@ <h5 class="modal-title">Resource</h5>
438440 return eventInterval . source === "Alert"
439441 }
440442
443+
444+ function isCertificateRotation ( eventInterval ) {
445+ if ( eventInterval . source != 'KubeEvent' ) {
446+ return false
447+ }
448+ if ( eventInterval . message . reason === "CertificateUpdated" ) {
449+ return true
450+ } ;
451+ if ( eventInterval . message . reason === "CertificateRemoved" ) {
452+ return true
453+ } ;
454+ if ( eventInterval . message . reason === "CertificateUpdateFailed" ) {
455+ return true
456+ } ;
457+ if ( eventInterval . message . reason === "ConfigMapUpdated" ) {
458+ return true
459+ } ;
460+ if ( eventInterval . message . reason === "SignerUpdateRequired" ) {
461+ return true
462+ } ;
463+ if ( eventInterval . message . reason === "CABundleUpdateRequired" ) {
464+ return true
465+ } ;
466+ if ( eventInterval . message . reason === "TargetUpdateRequired" ) {
467+ return true
468+ } ;
469+ if ( eventInterval . message . reason === "CSRCreated" ) {
470+ return true
471+ } ;
472+ if ( eventInterval . message . reason === "CSRApproved" ) {
473+ return true
474+ } ;
475+ if ( eventInterval . message . reason === "CertificateRotationStarted" ) {
476+ return true
477+ } ;
478+ if ( eventInterval . message . reason === "ClientCertificateCreated" ) {
479+ return true
480+ } ;
481+ if ( eventInterval . message . reason === "NoValidCertificateFound" ) {
482+ return true
483+ } ;
484+
485+
486+ return false ;
487+ }
488+
441489 function interestingEvents ( item ) {
442490 if ( item . message . annotations [ "pathological" ] === "true" ) {
443491 if ( item . message . annotations [ "interesting" ] === "true" ) {
@@ -866,6 +914,9 @@ <h5 class="modal-title">Resource</h5>
866914 timelineGroups . push ( { group : "interesting-events" , data : [ ] } ) ;
867915 createTimelineData ( interestingEvents , timelineGroups [ timelineGroups . length - 1 ] . data , filteredEvents , "interesting_events" ) ;
868916
917+ timelineGroups . push ( { group : "certificate-rotation" , data : [ ] } )
918+ createTimelineData ( "CertificateRotation" , timelineGroups [ timelineGroups . length - 1 ] . data , filteredEvents , "certificate_rotation" )
919+
869920 var segmentFunc = function ( segment ) {
870921 // Copy label to clipboard
871922 navigator . clipboard . writeText ( segment . labelVal ) ;
0 commit comments