Skip to content

Commit

Permalink
fix issue with local values file
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Dec 12, 2022
1 parent 725c473 commit 9804a00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion api/internal/builtins/HelmChartInflationGenerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func (p *plugin) validateArgs() (err error) {
// The ValuesFile may be consulted by the plugin, so it must
// be under the loader root (unless root restrictions are
// disabled).
for i, file := range p.ValuesFiles {
if u, urlErr := url.Parse(file); urlErr != nil || u.Scheme == "" {
p.ValuesFiles[i] = filepath.Join(p.h.Loader().Root(), file)
}
}
if len(p.ValuesFiles) == 0 {
p.ValuesFiles = append(p.ValuesFiles, filepath.Join(p.absChartHome(), p.Name, "values.yaml"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ name: minecraft
version: 3.1.3
repo: https://itzg.github.io/minecraft-server-charts
releaseName: moria
valuesFile: myValues.yaml
valuesFiles:
- myValues.yaml
`)
th.AssertActualEqualsExpected(
rm, fmt.Sprintf(expectedInflationFmt,
Expand Down

0 comments on commit 9804a00

Please sign in to comment.