Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/ControlPlane/FluxList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ export default function FluxList() {
return {
name: item.metadata.name,
isReady:
item.status.conditions.find((x) => x.type === 'Ready')?.status ===
item?.status?.conditions?.find((x) => x.type === 'Ready')?.status ===
'True',
statusUpdateTime: item.status.conditions.find((x) => x.type === 'Ready')
?.lastTransitionTime,
statusUpdateTime: item.status?.conditions?.find(
(x) => x.type === 'Ready',
)?.lastTransitionTime,
revision: shortenCommitHash(item.status.artifact?.revision ?? '-'),
created: timeAgo.format(new Date(item.metadata.creationTimestamp)),
item: item,
Expand All @@ -168,10 +169,11 @@ export default function FluxList() {
return {
name: item.metadata.name,
isReady:
item.status.conditions.find((x) => x.type === 'Ready')?.status ===
item.status?.conditions?.find((x) => x.type === 'Ready')?.status ===
'True',
statusUpdateTime: item.status.conditions.find((x) => x.type === 'Ready')
?.lastTransitionTime,
statusUpdateTime: item.status?.conditions?.find(
(x) => x.type === 'Ready',
)?.lastTransitionTime,
created: timeAgo.format(new Date(item.metadata.creationTimestamp)),
item: item,
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/ControlPlane/MCPHealthPopoverButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function MCPHealthPopoverButton({

const statusDetails = mcpStatus?.conditions
? `${t('MCPHealthPopoverButton.statusDetailsLabel')}: ${mcpStatus.status}\n\n${t('MCPHealthPopoverButton.detailsLabel')}\n` +
mcpStatus.conditions
mcpStatus?.conditions
.map((condition) => {
let text = `- ${condition.type}: ${condition.status}\n`;
if (condition.reason)
Expand Down Expand Up @@ -160,7 +160,7 @@ function StatusTable({
scaleWidthMode="Smart"
columns={tableColumns}
data={
status?.conditions.sort((a, b) => {
status?.conditions?.sort((a, b) => {
return a.type < b.type ? -1 : 1;
}) ?? []
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ControlPlane/ManagedResources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ export function ManagedResources() {
?.filter((managedResource) => managedResource.items)
.flatMap((managedResource) =>
managedResource.items?.map((item) => {
const conditionSynced = item.status.conditions?.find(
const conditionSynced = item.status?.conditions?.find(
(condition) => condition.type === 'Synced',
);
const conditionReady = item.status.conditions?.find(
const conditionReady = item.status?.conditions?.find(
(condition) => condition.type === 'Ready',
);

Expand Down
4 changes: 2 additions & 2 deletions src/components/ControlPlane/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ export function Providers() {

const rows: ProvidersRow[] =
providers?.items?.map((item) => {
const installed = item.status.conditions?.find(
const installed = item.status?.conditions?.find(
(condition) => condition.type === 'Installed',
);
const healthy = item.status.conditions?.find(
const healthy = item.status?.conditions?.find(
(condition) => condition.type === 'Healthy',
);
return {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/api/types/crossplane/listManagedResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export type ManagedResourcesResponse = [
name: string;
creationTimestamp: string;
};
status: {
conditions: [
status?: {
conditions?: [
{
type: 'Ready' | 'Synced' | unknown;
status: 'True' | 'False';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/api/types/crossplane/listProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export type ProvidersListResponse = {
name: string;
creationTimestamp: string;
};
status: {
conditions: [
status?: {
conditions?: [
{
type: 'Healthy' | 'Installed' | unknown;
status: 'True' | 'False';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/types/flux/listGitRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type GitReposResponse = {
artifact: {
revision: string;
};
conditions: [
conditions?: [
{
status: string;
type: string;
Expand Down
Loading