Skip to content

Commit

Permalink
fix(KFLUXUI-253): tekton results should filter unknown status record out
Browse files Browse the repository at this point in the history
  • Loading branch information
testcara committed Dec 13, 2024
1 parent 61e9ed9 commit 6cf087c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/utils/tekton-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,15 @@ export const getFilteredRecord = async <R extends K8sResourceCommon>(
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) {
Expand Down

0 comments on commit 6cf087c

Please sign in to comment.