From 06d20b8cae73855f321f27f39f323e66e96b308f Mon Sep 17 00:00:00 2001 From: Travis Hein Date: Tue, 14 Jan 2025 11:35:51 -0500 Subject: [PATCH] fix: Helm deploy was not working with variable templatinging chart path (#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. --- pkg/skaffold/deploy/helm/helm.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/skaffold/deploy/helm/helm.go b/pkg/skaffold/deploy/helm/helm.go index b66cbf416be..ed0c6d5a2fd 100644 --- a/pkg/skaffold/deploy/helm/helm.go +++ b/pkg/skaffold/deploy/helm/helm.go @@ -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) } }