Skip to content

Commit

Permalink
fix: Helm deploy was not working with variable templatinging chart pa…
Browse files Browse the repository at this point in the history
…th (#9600)

* fix: Helm deployer was not working with variable templatingin chartPath

I believe the chartPath property is supposed to be a templatable field.

In my use I have helm charts in a separate git repo from the application where the skaffold.yaml is.
We defined a skaffold.env.template file, that we add to git and then on checkout we copy this to skaffold.env and modify as needed,
so the path to the location to the other repo with a helm chart is a variable. and this skaffold.env file is added to the .gitignore

We noticed that we were getting
listing files: issue walking releases: lstat {{.HELM_REPO}}/helm/app/chart/path: no such file or directory

This PR fixes this issue.

* fix: lint warnings.
  • Loading branch information
travishein authored Jan 14, 2025
1 parent 59c01b7 commit 06d20b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/skaffold/deploy/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ func (h *Deployer) Dependencies() ([]string, error) {
return true, nil
}

if err := walk.From(release.ChartPath).When(isDep).AppendPaths(&deps); err != nil {
expandedPath, e := util.ExpandEnvTemplateOrFail(release.ChartPath, nil)
if e != nil {
return deps, helm.UserErr("issue expanding variable", e)
}
if err := walk.From(expandedPath).When(isDep).AppendPaths(&deps); err != nil {
return deps, helm.UserErr("issue walking releases", err)
}
}
Expand Down

0 comments on commit 06d20b8

Please sign in to comment.