Skip to content

Commit 7ae5591

Browse files
authored
Chartref issues (#134)
* fix: chart is optional, handling chartRef * fix: preventing undefined error * Making sourceRef linkable
1 parent f3b3b97 commit 7ae5591

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

web/src/ExpandedFooter.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ export function ExpandedFooter(props) {
3232
{
3333
name: "Kustomizations",
3434
href: "#",
35-
count: fluxState.kustomizations.length,
35+
count: fluxState.kustomizations?.length,
3636
},
3737
{
3838
name: "Helm Releases",
3939
href: "#",
40-
count: fluxState.helmReleases.length,
40+
count: fluxState.helmReleases?.length,
4141
},
4242
{
4343
name: "Terraform",
4444
href: "#",
45-
count: fluxState.tfResources.length,
45+
count: fluxState.tfResources?.length,
4646
},
4747
{ name: "Flux Runtime", href: "#", count: undefined },
4848
{ name: "Flux Events", href: "#", count: undefined },

web/src/HelmRevisionWidget.jsx

+16-4
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,35 @@ export function HelmRevisionWidget(props) {
2525
const reconciling = reconcilingCondition && reconcilingConditions[0].status === "True"
2626

2727
const sourceRef = helmRelease.spec.chart ? helmRelease.spec.chart.spec.sourceRef : helmRelease.spec.chartRef
28-
2928
const namespace = sourceRef.namespace ? sourceRef.namespace : helmRelease.metadata.namespace
3029
const navigationHandler = () => handleNavigationSelect("Sources", namespace, sourceRef.name, sourceRef.kind)
3130

3231
return (
3332
<>
3433
{!ready && reconciling && !stalled &&
3534
<span>
36-
<span>Attempting: </span>
35+
<span>Reconciling new version: </span>
36+
<NavigationButton handleNavigation={navigationHandler}>
37+
{helmRelease.spec.chart &&
3738
<span>{helmRelease.spec.chart.spec.version}@{helmRelease.spec.chart.spec.chart}</span>
39+
}
40+
{helmRelease.spec.chartRef &&
41+
<span>{`${helmRelease.spec.chartRef.namespace}/${helmRelease.spec.chartRef.name}`}</span>
42+
}
43+
</NavigationButton>
3844
</span>
3945
}
4046
{!ready && stalled &&
4147
<span className='bg-orange-400'>
42-
<span>Last Attempted: </span>
43-
{/* <span>{lastAttemptedRevision}@{version.chartName}</span> */}
48+
<span>Reconciliation stalled: </span>
49+
<NavigationButton handleNavigation={navigationHandler}>
50+
{helmRelease.spec.chart &&
4451
<span>{helmRelease.spec.chart.spec.version}@{helmRelease.spec.chart.spec.chart}</span>
52+
}
53+
{helmRelease.spec.chartRef &&
54+
<span>{`${helmRelease.spec.chartRef.namespace}/${helmRelease.spec.chartRef.name}`}</span>
55+
}
56+
</NavigationButton>
4557
</span>
4658
}
4759
<span className={`block ${ready || reconciling ? '' : 'font-normal text-neutral-600'} field`}>

0 commit comments

Comments
 (0)