Skip to content

Commit 3431166

Browse files
committed
pkg: Fix helm locate functionality
When the helm chart version is passed to Template function until this point the `LocateChart` function will search for the latest released chart available in the Helm Chart Repository index. The helm install action provides `ChartPathOptions` struct where version needs to be set in order to respect in locating the right Helm Chart.
1 parent 6825447 commit 3431166

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/helm/helm.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ func (c *Client) Template(ctx context.Context, chart string, opts TemplateOption
304304
// fake KubeClient.
305305
client := action.NewInstall(c.config)
306306

307+
client.ChartPathOptions.Version = opts.Version
308+
307309
// Options taken, more or less, directly from helm. This make the template
308310
// command not interact with a Kube APIServer.
309311
// https://github.com/helm/helm/blob/51a07e7e78cba05126a84c0d890851d7490d2e20/cmd/helm/template.go#L89-L94

0 commit comments

Comments
 (0)