From 78873461bf5f99e2f0761e16d1310c1f0845a1c7 Mon Sep 17 00:00:00 2001 From: Anthony ARNAUD Date: Tue, 3 Dec 2024 11:35:44 -0500 Subject: [PATCH] allow using helmChart without repo URL. Signed-off-by: Anthony ARNAUD --- api/internal/builtins/HelmChartInflationGenerator.go | 2 +- .../helmchartinflationgenerator/HelmChartInflationGenerator.go | 2 +- .../HelmChartInflationGenerator_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/internal/builtins/HelmChartInflationGenerator.go b/api/internal/builtins/HelmChartInflationGenerator.go index 06d13b5261..179bdf1940 100644 --- a/api/internal/builtins/HelmChartInflationGenerator.go +++ b/api/internal/builtins/HelmChartInflationGenerator.go @@ -153,7 +153,7 @@ func (p *HelmChartInflationGeneratorPlugin) absChartHome() string { chartHome = filepath.Join(p.h.Loader().Root(), p.ChartHome) } - if p.Version != "" && p.Repo != "" { + if p.Version != "" { return filepath.Join(chartHome, fmt.Sprintf("%s-%s", p.Name, p.Version)) } return chartHome diff --git a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go index 88527fe074..857223eca3 100644 --- a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go +++ b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go @@ -159,7 +159,7 @@ func (p *plugin) absChartHome() string { chartHome = filepath.Join(p.h.Loader().Root(), p.ChartHome) } - if p.Version != "" && p.Repo != "" { + if p.Version != "" { return filepath.Join(chartHome, fmt.Sprintf("%s-%s", p.Name, p.Version)) } return chartHome diff --git a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go index e6b414e9ec..036786bed5 100644 --- a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go +++ b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go @@ -849,7 +849,7 @@ releaseName: %s assert.True(t, len(rm.Resources()) > 0) var chartDir string - if tt.version != "" && tt.repo != "" { + if tt.version != "" { chartDir = fmt.Sprintf("charts/%s-%s/%s", tt.chartName, tt.version, tt.chartName) } else { chartDir = fmt.Sprintf("charts/%s", tt.chartName)