From 6cf087c80541ac675247df5104adc3a0fbc2e2f6 Mon Sep 17 00:00:00 2001 From: Cara Wang Date: Fri, 13 Dec 2024 21:43:46 +0800 Subject: [PATCH] fix(KFLUXUI-253): tekton results should filter unknown status record out --- src/utils/tekton-results.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/tekton-results.ts b/src/utils/tekton-results.ts index 8b957715..c5f0420a 100644 --- a/src/utils/tekton-results.ts +++ b/src/utils/tekton-results.ts @@ -263,7 +263,15 @@ export const getFilteredRecord = async ( records: list.records.slice(0, options.limit), }; } - return [list.records.map((result) => decodeValueJson(result.data.value)), list]; + const filteredRecords = list.records.reduce((acc, result) => { + const decodedResult = decodeValueJson(result.data.value); + if (decodedResult.status.conditions.every((c) => c.status !== 'Unknown')) { + acc.push(decodedResult); + } + return acc; + }, []); + + return [filteredRecords, list]; } catch (e) { // return an empty response if we get a 404 error if (e?.code === 404) {