From 7ae5591f0f5c9c8a31cc0a2f15b5feaa0ffee6e0 Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Wed, 16 Oct 2024 09:41:40 +0200 Subject: [PATCH] Chartref issues (#134) * fix: chart is optional, handling chartRef * fix: preventing undefined error * Making sourceRef linkable --- web/src/ExpandedFooter.jsx | 6 +++--- web/src/HelmRevisionWidget.jsx | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/web/src/ExpandedFooter.jsx b/web/src/ExpandedFooter.jsx index 501f092..7627878 100644 --- a/web/src/ExpandedFooter.jsx +++ b/web/src/ExpandedFooter.jsx @@ -32,17 +32,17 @@ export function ExpandedFooter(props) { { name: "Kustomizations", href: "#", - count: fluxState.kustomizations.length, + count: fluxState.kustomizations?.length, }, { name: "Helm Releases", href: "#", - count: fluxState.helmReleases.length, + count: fluxState.helmReleases?.length, }, { name: "Terraform", href: "#", - count: fluxState.tfResources.length, + count: fluxState.tfResources?.length, }, { name: "Flux Runtime", href: "#", count: undefined }, { name: "Flux Events", href: "#", count: undefined }, diff --git a/web/src/HelmRevisionWidget.jsx b/web/src/HelmRevisionWidget.jsx index c13205c..cd46d63 100644 --- a/web/src/HelmRevisionWidget.jsx +++ b/web/src/HelmRevisionWidget.jsx @@ -25,7 +25,6 @@ export function HelmRevisionWidget(props) { const reconciling = reconcilingCondition && reconcilingConditions[0].status === "True" const sourceRef = helmRelease.spec.chart ? helmRelease.spec.chart.spec.sourceRef : helmRelease.spec.chartRef - const namespace = sourceRef.namespace ? sourceRef.namespace : helmRelease.metadata.namespace const navigationHandler = () => handleNavigationSelect("Sources", namespace, sourceRef.name, sourceRef.kind) @@ -33,15 +32,28 @@ export function HelmRevisionWidget(props) { <> {!ready && reconciling && !stalled && - Attempting: + Reconciling new version: + + {helmRelease.spec.chart && {helmRelease.spec.chart.spec.version}@{helmRelease.spec.chart.spec.chart} + } + {helmRelease.spec.chartRef && + {`${helmRelease.spec.chartRef.namespace}/${helmRelease.spec.chartRef.name}`} + } + } {!ready && stalled && - Last Attempted: - {/* {lastAttemptedRevision}@{version.chartName} */} + Reconciliation stalled: + + {helmRelease.spec.chart && {helmRelease.spec.chart.spec.version}@{helmRelease.spec.chart.spec.chart} + } + {helmRelease.spec.chartRef && + {`${helmRelease.spec.chartRef.namespace}/${helmRelease.spec.chartRef.name}`} + } + }