Skip to content

Commit

Permalink
fix: helm repository detail view for oci repos
Browse files Browse the repository at this point in the history
  • Loading branch information
okaufmann committed Dec 18, 2023
1 parent a608fdb commit d82e1f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/details/sources/helm-repository-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class FluxCDHelmRepositoryDetails extends React.Component<

return (
<div>
<DrawerItem name="Status">{object.status?.conditions.find((s: any) => s.type === 'Ready').message}</DrawerItem>
<DrawerItem name="Status">{object.status?.conditions?.find((s: any) => s.type === 'Ready').message}</DrawerItem>
<DrawerItem name="Ready">
<Badge className={getStatusClass(object)} label={getStatusText(object)} />
</DrawerItem>
Expand Down
5 changes: 3 additions & 2 deletions src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function getStatusText<T extends Renderer.K8sApi.KubeObject>(obj: T): str
case 'in-progress':
return 'In Progress'
default:
return 'unknown'
return 'Unknown'
}
}

Expand All @@ -145,5 +145,6 @@ function getStatus<T extends Renderer.K8sApi.KubeObject>(obj: T) {
if (obj.spec.suspend) return 'suspended'
if (obj.status?.conditions?.find((c: any) => c.type === 'Ready').status === 'True') return 'ready'
if (obj.status?.conditions?.find((c: any) => c.type === 'Ready').status === 'False') return 'not-ready'
return 'in-progress'
if (obj.status?.conditions) return 'in-progress'
return ''
}

0 comments on commit d82e1f3

Please sign in to comment.