Skip to content

Commit

Permalink
fix: oci HelmRepositories don't have status
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Apr 11, 2024
1 parent fc6c8ec commit a2bbcd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions web/src/ReadyWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions web/src/Summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2bbcd1

Please sign in to comment.