From 73ee0c2374be77e06a675a2fc02900e8c864a42d Mon Sep 17 00:00:00 2001 From: Vanson Lim Date: Tue, 15 Aug 2023 10:15:41 -0400 Subject: [PATCH] Modify InstallOrUpgradeChart(), InstallChart() and UpgradeChart() to support specifying optional ChartPathOptions. --- client.go | 6 ++++++ types.go | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 2c65d157..f0a9a3bd 100644 --- a/client.go +++ b/client.go @@ -302,6 +302,9 @@ func (c *HelmClient) install(ctx context.Context, spec *ChartSpec, opts *Generic if opts.PostRenderer != nil { client.PostRenderer = opts.PostRenderer } + if opts.ChartPathOptions != nil { + client.ChartPathOptions = *(opts.ChartPathOptions) + } } helmChart, chartPath, err := c.GetChart(spec.ChartName, &client.ChartPathOptions) @@ -360,6 +363,9 @@ func (c *HelmClient) upgrade(ctx context.Context, spec *ChartSpec, opts *Generic if opts.PostRenderer != nil { client.PostRenderer = opts.PostRenderer } + if opts.ChartPathOptions != nil { + client.ChartPathOptions = *(opts.ChartPathOptions) + } } helmChart, chartPath, err := c.GetChart(spec.ChartName, &client.ChartPathOptions) diff --git a/types.go b/types.go index 6efb20e9..cb59238d 100644 --- a/types.go +++ b/types.go @@ -88,8 +88,9 @@ type HelmClient struct { } type GenericHelmOptions struct { - PostRenderer postrender.PostRenderer - RollBack RollBack + PostRenderer postrender.PostRenderer + RollBack RollBack + ChartPathOptions *action.ChartPathOptions } type HelmTemplateOptions struct {