From 2dcdc7bc2e89d5f514a9ae63c42f3371598cb7a9 Mon Sep 17 00:00:00 2001 From: Dustin Lish Date: Wed, 25 Jan 2023 20:30:59 -0700 Subject: [PATCH] Fix p.ValuesFile when version is set --- .../HelmChartInflationGenerator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go index 959528abe78..dd7d5b50837 100644 --- a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go +++ b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go @@ -97,7 +97,11 @@ func (p *plugin) validateArgs() (err error) { // be under the loader root (unless root restrictions are // disabled). if p.ValuesFile == "" { - p.ValuesFile = filepath.Join(p.ChartHome, p.Name, "values.yaml") + if p.Version != "" { + p.ValuesFile = filepath.Join(p.ChartHome, fmt.Sprintf("%s-%s", p.Name, p.Version), p.Name, "values.yaml") + } else { + p.ValuesFile = filepath.Join(p.ChartHome, p.Name, "values.yaml") + } } for i, file := range p.AdditionalValuesFiles { // use Load() to enforce root restrictions