From b124be81f01370c33081f01b26c053988f6e2739 Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Thu, 11 Apr 2024 09:13:40 +0200 Subject: [PATCH] fix: oci HelmRepositories don't have status (#89) --- web/src/ReadyWidget.jsx | 4 ++++ web/src/Summary.jsx | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/web/src/ReadyWidget.jsx b/web/src/ReadyWidget.jsx index e6a38be..0b5e7e3 100644 --- a/web/src/ReadyWidget.jsx +++ b/web/src/ReadyWidget.jsx @@ -5,6 +5,10 @@ import { TimeLabel } from './TimeLabel' export function ReadyWidget(props) { const { resource, displayMessage, label } = props + if (resource.kind === "HelmRepository" && resource.spec.type === 'oci') { + return null + } + const readyConditions = jp.query(resource.status, '$..conditions[?(@.type=="Ready")]'); const readyCondition = readyConditions.length === 1 ? readyConditions[0] : undefined const ready = readyCondition && readyConditions[0].status === "True" diff --git a/web/src/Summary.jsx b/web/src/Summary.jsx index 9ee2c8c..046d6ac 100644 --- a/web/src/Summary.jsx +++ b/web/src/Summary.jsx @@ -8,8 +8,11 @@ export function Summary(props) { } const totalCount = resources.length - const readyCount = resources.filter(resourece => { - const readyConditions = jp.query(resourece.status, '$..conditions[?(@.type=="Ready")]'); + const readyCount = resources.filter(resource => { + if (resource.kind === "HelmRepository" && resource.spec.type === 'oci') { + return true + } + const readyConditions = jp.query(resource.status, '$..conditions[?(@.type=="Ready")]'); const ready = readyConditions.length === 1 && readyConditions[0].status === "True" return ready }).length