Repository: helm/chart-testing (go)

Issue:
error when tested chart folder name is long

**Is this a request for help?**: maybe?

---

**Is this a BUG REPORT or FEATURE REQUEST?** (choose one): depends on your point of view, i would call it a BUG REPORT but the engineer in me could argue its a FEATURE REQUEST.

<!--
If this is a BUG REPORT, please:
  - Fill in as much of the template below as you can.  If you leave out
    information, we can't help you as well.

If this is a FEATURE REQUEST, please:
  - Describe *in detail* the feature/behavior/change you'd like to see.

In both cases, be ready for followup questions, and please respond in a timely
manner.  If we can't reproduce a bug or think a feature already exists, we
might close your issue.  If we're wrong, PLEASE feel free to reopen it and
explain why.
-->

**Version of Helm and Kubernetes**:

```
helm version
kubectl version
ct version
version.BuildInfo{Version:"v3.6.1", GitCommit:"61d8e8c4a6f95540c15c6a65f36a6dd0a45e7a2f", GitTreeState:"dirty", GoVersion:"go1.16.5"}
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-21T23:01:33Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}
Version:	 3.4.0
Git commit:	 68a43ac09699ef9473266457e893a7ddd7ef6b5b
Date:		 2021-05-22
License:	 Apache 2.0
```

**What happened**:

when running `ct install --charts charts/ploigos-workflow-everything-tekton-pipeline` I get the following:

short version:
```
Error: release name "ploigos-workflow-everything-tekton-pipeline-8y2c24lws7" exceeds max length of 53
```

long version
```
Installing charts...
Version increment checking disabled.

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 ploigos-workflow-everything-tekton-pipeline => (version: "0.16.2", path: "charts/ploigos-workflow-everything-tekton-pipeline")
------------------------------------------------------------------------------------------------------------------------

Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "haproxy-ingress" chart repository
...Successfully got an update from the "haproxytech" chart repository
...Successfully got an update from the "rhacs" chart repository
...Successfully got an update from the "gitlab" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Dependency ploigos-workflow-tekton-shared-resources did not declare a repository. Assuming it exists in the charts directory
Deleting outdated charts
walk.go:74: found symbolic link in path: /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-everything-tekton-pipeline/charts/ploigos-workflow-tekton-shared-resources resolves to /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-tekton-shared-resources
walk.go:74: found symbolic link in path: /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-everything-tekton-pipeline/charts/ploigos-workflow-tekton-shared-resources/charts/ploigos-workflow-shared-resources resolves to /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-shared-resources
walk.go:74: found symbolic link in path: /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-everything-tekton-pipeline/tmpcharts/ploigos-workflow-tekton-shared-resources/charts/ploigos-workflow-shared-resources resolves to /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-shared-resources
Installing chart 'ploigos-workflow-everything-tekton-pipeline => (version: "0.16.2", path: "charts/ploigos-workflow-everything-tekton-pipeline")'...

Installing chart with values file 'charts/ploigos-workflow-everything-tekton-pipeline/ci/test-values.yaml'...

Creating namespace 'ploigos-workflow-everything-tekton-pipeline-8y2c24lws7'...
namespace/ploigos-workflow-everything-tekton-pipeline-8y2c24lws7 created
walk.go:74: found symbolic link in path: /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-everything-tekton-pipeline/charts/ploigos-workflow-tekton-shared-resources resolves to /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-tekton-shared-resources
walk.go:74: found symbolic link in path: /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-everything-tekton-pipeline/charts/ploigos-workflow-tekton-shared-resources/charts/ploigos-workflow-shared-resources resolves to /Users/itewk/Projects/SPO/ploigos-charts/charts/ploigos-workflow-shared-resources
Error: release name "ploigos-workflow-everything-tekton-pipeline-8y2c24lws7" exceeds max length of 53
```

**What you expected to happen**:

No error. either "it just works" by shortnening the release name, or have an option to specify a release name.

**How to reproduce it** (as minimally and precisely as possible): 100%


**Anything else we need to know**:

I dug through the code and found these relevent sections:

* https://github.com/helm/chart-testing/blob/main/pkg/chart/chart.go#L656
* https://github.com/helm/chart-testing/blob/main/pkg/chart/chart.go#L663
* https://github.com/helm/chart-testing/blob/main/pkg/chart/chart.go#L202-L216

Which I am reading as that the release name used during testing is always based on the folder name, or if the folder path was . then the chart  name is used from Chart.yaml. The problem is if fodler name/chart name is to long. When using `helm` directly one can specify the name to use, but there is no option to do that with chart-tester making it impossible to test this chart (without changing the folder name).

Also https://github.com/helm/chart-testing/blob/main/pkg/util/util.go#L226-L235 looks like it should be making the release name short enough, but its cutting it down to 63 but the error is about 53.



Pull request:
Add release-name option
**What this PR does / why we need it**: Adds an additional option for release name. Allows charts with long names and additional resources that may append more length to the release name to work with kubernetes 63 character limitation. 

**Which issue this PR fixes** : fixes #343 , #734 

**Special notes for your reviewer**: 


Patch:
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index fd0d6fc..2178216 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -20,7 +20,7 @@ jobs:
         uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
 
       - name: Setup go
-        uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
+        uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
         with:
           go-version-file: './go.mod'
           check-latest: true
@@ -36,7 +36,7 @@ jobs:
         uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
 
       - name: Install syft
-        uses: anchore/sbom-action/download-syft@9f7302141466aa6482940f15371237e9d9f4c34a # v0.19.0
+        uses: anchore/sbom-action/download-syft@e11c554f704a0b820cbf8c51673f6945e0731532 # v0.20.0
 
       - name: Install k8s Kind
         uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.3.0
@@ -81,7 +81,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-      - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
+      - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
         with:
           go-version-file: './go.mod'
           check-latest: true
@@ -102,7 +102,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-      - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
+      - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
         with:
           go-version-file: './go.mod'
           check-latest: true
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 60d9941..f1559e0 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -25,7 +25,7 @@ jobs:
         uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
 
       - name: Setup go
-        uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
+        uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
         with:
           go-version-file: './go.mod'
           check-latest: true
@@ -39,7 +39,7 @@ jobs:
         uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
 
       - name: Install syft
-        uses: anchore/sbom-action/download-syft@9f7302141466aa6482940f15371237e9d9f4c34a # v0.19.0
+        uses: anchore/sbom-action/download-syft@e11c554f704a0b820cbf8c51673f6945e0731532 # v0.20.0
 
       - name: Install tools
         run: |
diff --git a/ct/cmd/install.go b/ct/cmd/install.go
index 734ea07..98180e0 100644
--- a/ct/cmd/install.go
+++ b/ct/cmd/install.go
@@ -71,6 +71,9 @@ func addInstallFlags(flags *flag.FlagSet) {
 	flags.String("namespace", "", heredoc.Doc(`
 		Namespace to install the release(s) into. If not specified, each release will be
 		installed in its own randomly generated namespace`))
+	flags.String("release-name", "", heredoc.Doc(`
+		Name for the release. If not specified, is set to the chart name and a random 
+		identifier.`))
 	flags.String("release-label", "app.kubernetes.io/instance", heredoc.Doc(`
 		The label to be used as a selector when inspecting resources created by charts.
 		This is only used if namespace is specified`))
diff --git a/doc/ct_install.md b/doc/ct_install.md
index fe1e72d..27b5697 100644
--- a/doc/ct_install.md
+++ b/doc/ct_install.md
@@ -68,6 +68,8 @@ ct install [flags]
                                              expose sensitive data when helm-repo-extra-args contains passwords)
       --release-label string                 The label to be used as a selector when inspecting resources created by charts.
                                              This is only used if namespace is specified (default "app.kubernetes.io/instance")
+      --release-name string                  Name for the release. If not specified, is set to the chart name and a random 
+                                             identifier.
       --remote string                        The name of the Git remote used to identify changed charts (default "origin")
       --since string                         The Git reference used to identify changed charts (default "HEAD")
       --skip-clean-up                        Skip resources clean-up. Used if need to continue other flows or keep it around.
diff --git a/doc/ct_lint-and-install.md b/doc/ct_lint-and-install.md
index 924f02b..0b341b9 100644
--- a/doc/ct_lint-and-install.md
+++ b/doc/ct_lint-and-install.md
@@ -63,6 +63,8 @@ ct lint-and-install [flags]
                                              expose sensitive data when helm-repo-extra-args contains passwords)
       --release-label string                 The label to be used as a selector when inspecting resources created by charts.
                                              This is only used if namespace is specified (default "app.kubernetes.io/instance")
+      --release-name string                  Name for the release. If not specified, is set to the chart name and a random 
+                                             identifier.
       --remote string                        The name of the Git remote used to identify changed charts (default "origin")
       --since string                         The Git reference used to identify changed charts (default "HEAD")
       --skip-clean-up                        Skip resources clean-up. Used if need to continue other flows or keep it around.
diff --git a/etc/chart_schema.yaml b/etc/chart_schema.yaml
index 2a26d9b..e3cd46a 100644
--- a/etc/chart_schema.yaml
+++ b/etc/chart_schema.yaml
@@ -29,7 +29,7 @@ dependency:
   condition: str(required=False)
   tags: list(str(), required=False)
   enabled: bool(required=False)
-  import-values: any(list(str()), list(include('import-value')), required=False)
+  import-values: list(any(str(), include('import-value')), required=False)
   alias: str(required=False)
 ---
 import-value:
diff --git a/go.mod b/go.mod
index 5a2f717..f03d07e 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module github.com/helm/chart-testing/v3
 
-go 1.23
+go 1.24.0
 
 require (
 	github.com/MakeNowJust/heredoc v1.0.0
@@ -14,7 +14,7 @@ require (
 	github.com/spf13/viper v1.20.1
 	github.com/stretchr/testify v1.10.0
 	gopkg.in/yaml.v2 v2.4.0
-	helm.sh/helm/v3 v3.16.4
+	helm.sh/helm/v3 v3.18.0
 )
 
 require (
@@ -37,8 +37,8 @@ require (
 	github.com/subosito/gotenv v1.6.0 // indirect
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.9.0 // indirect
-	golang.org/x/sys v0.29.0 // indirect
-	golang.org/x/text v0.21.0 // indirect
+	golang.org/x/sys v0.33.0 // indirect
+	golang.org/x/text v0.24.0 // indirect
 	gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/go.sum b/go.sum
index 0e4e7da..a57ea59 100644
--- a/go.sum
+++ b/go.sum
@@ -16,8 +16,8 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
 github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
 github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
 github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
+github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
 github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
 github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@@ -83,10 +83,10 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
 go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
 go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
-golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
-golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
-golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
+golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
+golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
+golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -94,5 +94,5 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-helm.sh/helm/v3 v3.16.4 h1:rBn/h9MACw+QlhxQTjpl8Ifx+VTWaYsw3rguGBYBzr0=
-helm.sh/helm/v3 v3.16.4/go.mod h1:k8QPotUt57wWbi90w3LNmg3/MWcLPigVv+0/X4B8BzA=
+helm.sh/helm/v3 v3.18.0 h1:ItOAm3Quo0dus3NUHjs+lluqWWEIO7xrSW+zKWCrvlw=
+helm.sh/helm/v3 v3.18.0/go.mod h1:43QHS1W97RcoFJRk36ZBhHdTfykqBlJdsWp3yhzdq8w=
diff --git a/pkg/chart/chart.go b/pkg/chart/chart.go
index 227ecc7..54fb192 100644
--- a/pkg/chart/chart.go
+++ b/pkg/chart/chart.go
@@ -79,7 +79,8 @@ type Git interface {
 // InstallWithValues runs `helm install` for the given chart using the specified values file.
 // Pass a zero value for valuesFile in order to run install without specifying a values file.
 //
-// Upgrade runs `helm upgrade` against an existing release, and re-uses the previously computed values.
+// UpgradeWithValues runs `helm upgrade` against an existing release using the specified values file.
+// Pass a zero value for valuesFile in order to run install without specifying a values file.
 //
 // Test runs `helm test` against an existing release. Set the cleanup argument to true in order
 // to clean up test pods created by helm after the test command completes.
@@ -91,7 +92,7 @@ type Helm interface {
 	BuildDependenciesWithArgs(chart string, extraArgs []string) error
 	LintWithValues(chart string, valuesFile string) error
 	InstallWithValues(chart string, valuesFile string, namespace string, release string) error
-	Upgrade(chart string, namespace string, release string) error
+	UpgradeWithValues(chart string, valuesFile string, namespace string, release string) error
 	Test(namespace string, release string) error
 	DeleteRelease(namespace string, release string)
 	Version() (string, error)
@@ -205,12 +206,17 @@ func (c *Chart) HasCIValuesFile(path string) bool {
 }
 
 // CreateInstallParams generates a randomized release name and namespace based on the chart path
-// and optional buildID. If a buildID is specified, it will be part of the generated namespace.
-func (c *Chart) CreateInstallParams(buildID string) (release string, namespace string) {
+// and optional buildID. If release_name is specified, the release name is set to that string instead.
+// If a buildID is specified, it will be part of the generated namespace.
+func (c *Chart) CreateInstallParams(buildID string, releaseName string) (release string, namespace string) {
 	release = filepath.Base(c.Path())
 	if release == "." || release == "/" {
-		yaml := c.Yaml()
-		release = yaml.Name
+		if releaseName != "" {
+			release = releaseName
+		} else {
+			yaml := c.Yaml()
+			release = yaml.Name
+		}
 	}
 	namespace = release
 	if buildID != "" {
@@ -660,7 +666,7 @@ func (t *Testing) doUpgrade(oldChart, newChart *Chart, oldChartMustPass bool) er
 				return nil
 			}
 
-			if err := t.helm.Upgrade(newChart.Path(), namespace, release); err != nil {
+			if err := t.helm.UpgradeWithValues(newChart.Path(), valuesFile, namespace, release); err != nil {
 				return err
 			}
 
@@ -686,14 +692,14 @@ func (t *Testing) testRelease(namespace, release, releaseSelector string) error
 func (t *Testing) generateInstallConfig(chart *Chart) (namespace, release, releaseSelector string, cleanup func()) {
 	if t.config.Namespace != "" {
 		namespace = t.config.Namespace
-		release, _ = chart.CreateInstallParams(t.config.BuildID)
+		release, _ = chart.CreateInstallParams(t.config.BuildID, t.config.ReleaseName)
 		releaseSelector = fmt.Sprintf("%s=%s", t.config.ReleaseLabel, release)
 		cleanup = func() {
 			t.PrintEventsPodDetailsAndLogs(namespace, releaseSelector)
 			t.helm.DeleteRelease(namespace, release)
 		}
 	} else {
-		release, namespace = chart.CreateInstallParams(t.config.BuildID)
+		release, namespace = chart.CreateInstallParams(t.config.BuildID, t.config.ReleaseName)
 		cleanup = func() {
 			t.PrintEventsPodDetailsAndLogs(namespace, releaseSelector)
 			t.helm.DeleteRelease(namespace, release)
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 6afa353..981b276 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -70,6 +70,7 @@ type Configuration struct {
 	SkipMissingValues       bool          `mapstructure:"skip-missing-values"`
 	SkipCleanUp             bool          `mapstructure:"skip-clean-up"`
 	Namespace               string        `mapstructure:"namespace"`
+	ReleaseName             string        `mapstructure:"release-name"`
 	ReleaseLabel            string        `mapstructure:"release-label"`
 	ExcludeDeprecated       bool          `mapstructure:"exclude-deprecated"`
 	KubectlTimeout          time.Duration `mapstructure:"kubectl-timeout"`
diff --git a/pkg/tool/helm.go b/pkg/tool/helm.go
index 42724b0..024934a 100644
--- a/pkg/tool/helm.go
+++ b/pkg/tool/helm.go
@@ -75,9 +75,14 @@ func (h Helm) InstallWithValues(chart string, valuesFile string, namespace strin
 		"--wait", values, h.extraArgs, h.extraSetArgs)
 }
 
-func (h Helm) Upgrade(chart string, namespace string, release string) error {
+func (h Helm) UpgradeWithValues(chart string, valuesFile string, namespace string, release string) error {
+	var values []string
+	if valuesFile != "" {
+		values = []string{"--values", valuesFile}
+	}
+
 	return h.exec.RunProcess("helm", "upgrade", release, chart, "--namespace", namespace,
-		"--reuse-values", "--wait", h.extraArgs, h.extraSetArgs)
+		"--wait", values, h.extraArgs, h.extraSetArgs)
 }
 
 func (h Helm) Test(namespace string, release string) error {


Test patch:
diff --git a/pkg/chart/chart_test.go b/pkg/chart/chart_test.go
index 901677c..b95dd9e 100644
--- a/pkg/chart/chart_test.go
+++ b/pkg/chart/chart_test.go
@@ -111,7 +111,7 @@ func (h *fakeHelm) LintWithValues(_ string, _ string) error { return nil }
 func (h *fakeHelm) InstallWithValues(_ string, _ string, _ string, _ string) error {
 	return nil
 }
-func (h *fakeHelm) Upgrade(_ string, _ string, _ string) error {
+func (h *fakeHelm) UpgradeWithValues(_ string, _ string, _ string, _ string) error {
 	return nil
 }
 func (h *fakeHelm) Test(_ string, _ string) error {