File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,17 @@ function AutomationsTable({
106
106
sourceNamespace = sourceRef ?. namespace ;
107
107
} else {
108
108
const hr = a as HelmRelease ;
109
- sourceKind = Kind . HelmChart ;
110
- sourceName = hr . helmChart ?. name ;
111
- sourceNamespace = hr . helmChart ?. namespace ;
109
+ if ( hr . helmChartRef ) {
110
+ // handle the case when spec.chartRef is set
111
+ sourceKind = hr . helmChartRef . kind ;
112
+ sourceName = hr . helmChartRef . name ;
113
+ sourceNamespace = hr . helmChartRef . namespace ;
114
+ } else {
115
+ // otherwise, spec.chart must be set
116
+ sourceKind = Kind . HelmChart ;
117
+ sourceName = hr . helmChart ?. name ;
118
+ sourceNamespace = hr . helmChart ?. namespace ;
119
+ }
112
120
}
113
121
114
122
return (
Original file line number Diff line number Diff line change @@ -277,6 +277,19 @@ export class HelmRelease extends FluxObject {
277
277
return this . obj . status ?. helmChart || "" ;
278
278
}
279
279
280
+ get helmChartRef ( ) : ObjectRef | undefined {
281
+ if ( ! this . obj . spec ?. chartRef ) {
282
+ return ;
283
+ }
284
+ const chartRef = {
285
+ ...this . obj . spec . chartRef ,
286
+ } ;
287
+ if ( ! chartRef . namespace ) {
288
+ chartRef . namespace = this . namespace ;
289
+ }
290
+ return chartRef ;
291
+ }
292
+
280
293
get helmChart ( ) : HelmChart {
281
294
// This isn't a "real" helmchart object - it has much fewer fields,
282
295
// and requires some data mangling to work at all
You can’t perform that action at this time.
0 commit comments