diff --git a/integration/run_test.go b/integration/run_test.go index 59d03d6d389..e877ee7b03d 100644 --- a/integration/run_test.go +++ b/integration/run_test.go @@ -146,6 +146,13 @@ var tests = []struct { dir: "examples/custom", pods: []string{"getting-started-custom"}, }, + { + description: "helm templating charPath", + dir: "testdata/helm", + args: []string{"-p", "helm-templating-charPath"}, + deployments: []string{"skaffold-helm"}, + env: []string{"FOO=skaffold-helm"}, + }, // TODO(#8811): Enable this test when issue is solve. // { // description: "buildpacks Go", diff --git a/integration/testdata/helm/skaffold.yaml b/integration/testdata/helm/skaffold.yaml index 8dc91c2bc09..aa0e5fe68e9 100644 --- a/integration/testdata/helm/skaffold.yaml +++ b/integration/testdata/helm/skaffold.yaml @@ -43,4 +43,10 @@ profiles: releases: # seed test namespace in the release name. - name: skaffold-helm-{{.TEST_NS}} - chartPath: skaffold-helm \ No newline at end of file + chartPath: skaffold-helm +- name: helm-templating-charPath + deploy: + helm: + releases: + - name: skaffold-helm + chartPath: '{{.FOO}}' \ No newline at end of file diff --git a/pkg/skaffold/deploy/helm/helm.go b/pkg/skaffold/deploy/helm/helm.go index 99dca27ec4c..89c74acebfa 100644 --- a/pkg/skaffold/deploy/helm/helm.go +++ b/pkg/skaffold/deploy/helm/helm.go @@ -276,6 +276,11 @@ func (h *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Art if err != nil { return helm.UserErr(fmt.Sprintf("cannot expand repo %q", r.Repo), err) } + r.ChartPath, err = util.ExpandEnvTemplateOrFail(r.ChartPath, nil) + if err != nil { + return helm.UserErr(fmt.Sprintf("cannot expand chart path %q", r.ChartPath), err) + } + m, results, err := h.deployRelease(ctx, out, releaseName, r, builds, h.bV, chartVersion, repo) if err != nil { return helm.UserErr(fmt.Sprintf("deploying %q", releaseName), err)