From 5cd579fc92337ab5f415d422eaf9d8ecd9a0e440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Gustav=20Str=C3=A5b=C3=B8?= Date: Fri, 23 Apr 2021 14:12:44 +0200 Subject: [PATCH 1/2] show restartCount for events --- src/components/events-list/event-summary.js | 7 +++++++ src/components/page-replica/index.js | 2 +- src/models/replica-summary/normaliser.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/events-list/event-summary.js b/src/components/events-list/event-summary.js index c49381c23..4d5ec979d 100644 --- a/src/components/events-list/event-summary.js +++ b/src/components/events-list/event-summary.js @@ -31,6 +31,13 @@ const EventSummary = ({ event }) => {
  • {event.reason} - {event.message} + {event.involvedObjectState && + event.involvedObjectState.pod && + event.involvedObjectState.pod.restartCount > 0 && ( + + . Restarted {event.involvedObjectState.pod.restartCount} times + + )} {isWarningEvent(event) && }
  • diff --git a/src/components/page-replica/index.js b/src/components/page-replica/index.js index df9340c78..516c42021 100644 --- a/src/components/page-replica/index.js +++ b/src/components/page-replica/index.js @@ -104,7 +104,7 @@ const PageReplica = (props) => { )} {selectedReplica && - selectedReplica.restartCount != NaN && + Number.isNaN(selectedReplica.restartCount) && selectedReplica.restartCount > 0 && (

    Restarted {selectedReplica.restartCount} times

    )} diff --git a/src/models/replica-summary/normaliser.js b/src/models/replica-summary/normaliser.js index bc245b6b1..6d3715fad 100644 --- a/src/models/replica-summary/normaliser.js +++ b/src/models/replica-summary/normaliser.js @@ -14,7 +14,7 @@ export const normaliser = (props) => { replica.status = props.replicaStatus.status; replica.created = replica.created ? new Date(replica.created) : null; let restartCount = parseInt(replica.restartCount); - replica.restartCount = restartCount === NaN ? 0 : restartCount; + replica.restartCount = Number.isNaN(restartCount) ? 0 : restartCount; return Object.freeze(replica); }; From 236ff4d48454a22a668632c1921e9ec6b178a1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Gustav=20Str=C3=A5b=C3=B8?= Date: Fri, 23 Apr 2021 15:01:44 +0200 Subject: [PATCH 2/2] fix error --- src/components/page-replica/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/page-replica/index.js b/src/components/page-replica/index.js index 516c42021..d89834592 100644 --- a/src/components/page-replica/index.js +++ b/src/components/page-replica/index.js @@ -104,7 +104,7 @@ const PageReplica = (props) => { )} {selectedReplica && - Number.isNaN(selectedReplica.restartCount) && + !Number.isNaN(selectedReplica.restartCount) && selectedReplica.restartCount > 0 && (

    Restarted {selectedReplica.restartCount} times

    )}