From e6577ca269dd4dfaa01bc5745fa719e93bd0b3f8 Mon Sep 17 00:00:00 2001 From: Steven Kang Date: Tue, 12 Nov 2024 09:42:14 +1300 Subject: [PATCH] kubernetes: improved the node view [r8s-47] (#108) --- .../cluster/HomeView/NodesDatatable/columns/conditions.tsx | 6 +++--- .../cluster/HomeView/NodesDatatable/columns/status.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/conditions.tsx b/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/conditions.tsx index 7d6e70735..633a5c2e1 100644 --- a/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/conditions.tsx +++ b/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/conditions.tsx @@ -14,7 +14,7 @@ export const conditions = columnHelper.accessor((row) => getConditions(row), { Conditions ), @@ -45,9 +45,9 @@ function ConditionsCell({ function getConditions(node: NodeRowData) { return ( - // exclude the Ready condition as it is already being utilised in the Status column + // exclude the Ready condition and search for unhealthy conditions node.status?.conditions?.filter( - (condition) => condition.type !== 'Ready' + (condition) => condition.type !== 'Ready' && condition.status === 'True' ) ?? [] ); } diff --git a/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/status.tsx b/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/status.tsx index e0285a476..6f284472f 100644 --- a/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/status.tsx +++ b/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/status.tsx @@ -36,7 +36,9 @@ function StatusCell({ function getStatus(node: NodeRowData) { return ( - node.status?.conditions?.find((condition) => condition.status === 'True') - ?.type ?? 'Not ready' + // only look for the ready type to identify if the node is either ready or not ready + node.status?.conditions?.find( + (condition) => condition.status === 'True' && condition.type === 'Ready' + )?.type ?? 'Not Ready' ); }