From e8b053d999952c1a80fce234ad9b8ec3662e207b Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Thu, 28 May 2026 17:27:28 +0100 Subject: [PATCH 1/6] fix: avoid importing testing package in release builds internal/version and pkg/chart/common imported "testing" only to call testing.Testing(), pulling the testing package and its dependencies into release binaries. Replace those checks with exported KubeVersionMajorTesting / KubeVersionMinorTesting sentinels that default to zero. A new build-tagged file internal/version/version_helmtest.go seeds them in init() and only compiles under -tags helmtest. The Makefile applies -tags helmtest as a baseline so test-unit and test-coverage work directly or via `make test`. scripts/coverage.sh passes the tag to its raw `go test` call. CONTRIBUTING.md documents that contributors running tests outside the Makefile must pass the tag themselves. Signed-off-by: Evans Mungai --- CONTRIBUTING.md | 14 +++++++++++++ Makefile | 5 +++++ internal/version/version.go | 13 ++++++------ internal/version/version_helmtest.go | 31 ++++++++++++++++++++++++++++ pkg/chart/common/capabilities.go | 10 ++------- scripts/coverage.sh | 2 +- 6 files changed, 59 insertions(+), 16 deletions(-) create mode 100644 internal/version/version_helmtest.go diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7aa19972f..5ffbfaa5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -232,6 +232,20 @@ guide](https://helm.sh/docs/community/developers/) to get started. Coding conventions and standards are explained in the [official developer docs](https://helm.sh/docs/developers/). +### Running tests + +Use the Makefile targets (`make test`, `make test-unit`, `make test-coverage`) +rather than invoking `go test ./...` directly. The Makefile passes the +`helmtest` build tag, which is required: it activates +`internal/version/version_helmtest.go` to seed testing-version sentinels. Test +binaries have no module info, so without this tag the production code path +attempts to read `k8s.io/client-go`'s version from build info and panics during +package init. + +If you run tests outside the Makefile (IDE test runners, `go test` directly, +custom CI), pass `-tags helmtest`. The tag is omitted from release builds so +the `testing` package and its dependencies stay out of shipped binaries. + ## Pull Requests Like any good open source project, we use Pull Requests (PRs) to track code changes. diff --git a/Makefile b/Makefile index 81b149a68..1254ec374 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,11 @@ endif test: test-style test: test-unit +# The `helmtest` build tag activates internal/version/version_helmtest.go, +# which seeds testing-version sentinels so test binaries don't panic reading +# missing module info. Applied to all test invocations. +TESTFLAGS += -tags helmtest + .PHONY: test-unit test-unit: @echo diff --git a/internal/version/version.go b/internal/version/version.go index 007f79f16..dfd58c081 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -17,12 +17,10 @@ limitations under the License. package version import ( - "flag" "fmt" "log/slog" "runtime" "strings" - "testing" "github.com/Masterminds/semver/v3" ) @@ -44,8 +42,9 @@ var ( gitTreeState = "" ) -const ( - kubeClientGoVersionTesting = "v1.20" +var ( + KubeVersionMajorTesting uint64 + KubeVersionMinorTesting uint64 ) // BuildInfo describes the compile time information. @@ -82,8 +81,8 @@ func Get() BuildInfo { // Test builds don't include debug info / module info // (And even if they did, we probably want a stable version during tests anyway) // Return a default value for test builds - if testing.Testing() { - return kubeClientGoVersionTesting + if KubeVersionMajorTesting != 0 && KubeVersionMinorTesting != 0 { + return fmt.Sprintf("v%d.%d", KubeVersionMajorTesting, KubeVersionMinorTesting) } vstr, err := K8sIOClientGoModVersion() @@ -113,7 +112,7 @@ func Get() BuildInfo { } // HACK(bacongobbler): strip out GoVersion during a test run for consistent test output - if flag.Lookup("test.v") != nil { + if KubeVersionMajorTesting != 0 && KubeVersionMinorTesting != 0 { v.GoVersion = "" } return v diff --git a/internal/version/version_helmtest.go b/internal/version/version_helmtest.go new file mode 100644 index 000000000..0354d0985 --- /dev/null +++ b/internal/version/version_helmtest.go @@ -0,0 +1,31 @@ +//go:build helmtest + +/* +Copyright The Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package version + +// This file is only compiled when the `helmtest` build tag is set (applied by +// the Makefile to all test invocations). It seeds the testing-version +// sentinels so that production code paths in this package and in +// pkg/chart/common substitute stable values instead of attempting to read +// build info from a `go test` binary (which has no module info and would +// panic during package init). + +func init() { + KubeVersionMajorTesting = 1 + KubeVersionMinorTesting = 20 +} diff --git a/pkg/chart/common/capabilities.go b/pkg/chart/common/capabilities.go index 20f4953cf..135476107 100644 --- a/pkg/chart/common/capabilities.go +++ b/pkg/chart/common/capabilities.go @@ -20,7 +20,6 @@ import ( "slices" "strconv" "strings" - "testing" "github.com/Masterminds/semver/v3" "k8s.io/client-go/kubernetes/scheme" @@ -32,11 +31,6 @@ import ( helmversion "helm.sh/helm/v4/internal/version" ) -const ( - kubeVersionMajorTesting = 1 - kubeVersionMinorTesting = 20 -) - var ( // DefaultVersionSet is the default version set, which includes only Core V1 ("v1"). DefaultVersionSet = allKnownVersions() @@ -146,8 +140,8 @@ func makeDefaultCapabilities() (*Capabilities, error) { // Test builds don't include debug info / module info // (And even if they did, we probably want stable capabilities for tests anyway) // Return a default value for test builds - if testing.Testing() { - return newCapabilities(kubeVersionMajorTesting, kubeVersionMinorTesting) + if helmversion.KubeVersionMajorTesting != 0 && helmversion.KubeVersionMinorTesting != 0 { + return newCapabilities(helmversion.KubeVersionMajorTesting, helmversion.KubeVersionMinorTesting) } vstr, err := helmversion.K8sIOClientGoModVersion() diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 4a29a68ad..b07d5d7fd 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -37,7 +37,7 @@ generate_cover_data() { for d in $(go list "$target"); do ( local output="${coverdir}/${d//\//-}.cover" - go test -coverprofile="${output}" -covermode="$covermode" "$d" + go test -tags helmtest -coverprofile="${output}" -covermode="$covermode" "$d" ) done From 24e03e3dabcf996830ee7037cff8c2fbbe5c0c31 Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Thu, 28 May 2026 18:21:57 +0100 Subject: [PATCH 2/6] refactor: add general-purpose test-mode signal in internal/test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce test.IsTestMode(), backed by a compile-time const seeded by two mutually-exclusive build-tagged files (test_mode_on.go under -tags helmtest, test_mode_off.go otherwise). Branches gated on it dead-code-eliminate in release builds. Available for any production code path that needs to behave differently under test. Not yet consumed — internal/version and pkg/chart/common continue to gate on the KubeVersionMajorTesting / KubeVersionMinorTesting sentinels seeded by internal/version/version_helmtest.go. Signed-off-by: Evans Mungai --- internal/test/test.go | 9 +++++++++ internal/test/test_mode_off.go | 21 +++++++++++++++++++++ internal/test/test_mode_on.go | 21 +++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 internal/test/test_mode_off.go create mode 100644 internal/test/test_mode_on.go diff --git a/internal/test/test.go b/internal/test/test.go index 202e015ab..e3c5b9c68 100644 --- a/internal/test/test.go +++ b/internal/test/test.go @@ -27,6 +27,15 @@ import ( // UpdateGolden writes out the golden files with the latest values, rather than failing the test. var updateGolden = flag.Bool("update", false, "update golden files") +// IsTestMode reports whether the binary was built with -tags helmtest. +// General-purpose signal that the binary was built for tests; consult it +// from production code paths that need to behave differently under test. +// Backed by a compile-time const (see test_mode_on.go / test_mode_off.go) +// so branches gated on it dead-code-eliminate in release builds. +func IsTestMode() bool { + return testMode +} + // TestingT describes a testing object compatible with the critical functions from the testing.T type type TestingT interface { Fatal(...any) diff --git a/internal/test/test_mode_off.go b/internal/test/test_mode_off.go new file mode 100644 index 000000000..62534ed12 --- /dev/null +++ b/internal/test/test_mode_off.go @@ -0,0 +1,21 @@ +//go:build !helmtest + +/* +Copyright The Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package test + +const testMode = false diff --git a/internal/test/test_mode_on.go b/internal/test/test_mode_on.go new file mode 100644 index 000000000..8a2978699 --- /dev/null +++ b/internal/test/test_mode_on.go @@ -0,0 +1,21 @@ +//go:build helmtest + +/* +Copyright The Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package test + +const testMode = true From e2704403af3a592be97154a76f60dcf4e0daecf5 Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Thu, 28 May 2026 18:25:08 +0100 Subject: [PATCH 3/6] Add missed changes Signed-off-by: Evans Mungai --- internal/version/version.go | 17 ++++++++++----- internal/version/version_helmtest.go | 31 ---------------------------- pkg/chart/common/capabilities.go | 3 ++- 3 files changed, 14 insertions(+), 37 deletions(-) delete mode 100644 internal/version/version_helmtest.go diff --git a/internal/version/version.go b/internal/version/version.go index dfd58c081..1259e8437 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -23,6 +23,8 @@ import ( "strings" "github.com/Masterminds/semver/v3" + + "helm.sh/helm/v4/internal/test" ) var ( @@ -42,9 +44,14 @@ var ( gitTreeState = "" ) -var ( - KubeVersionMajorTesting uint64 - KubeVersionMinorTesting uint64 +// Stub Kubernetes version values for use by any test path that needs a +// stable kube major/minor — for example, substituting into capabilities or +// client-go version strings so test output doesn't drift with the +// k8s.io/client-go version pinned in go.mod. Callers decide when to use +// them; they are not tied to any particular build tag or gating mechanism. +const ( + KubeVersionMajorTesting uint64 = 1 + KubeVersionMinorTesting uint64 = 20 ) // BuildInfo describes the compile time information. @@ -81,7 +88,7 @@ func Get() BuildInfo { // Test builds don't include debug info / module info // (And even if they did, we probably want a stable version during tests anyway) // Return a default value for test builds - if KubeVersionMajorTesting != 0 && KubeVersionMinorTesting != 0 { + if test.IsTestMode() { return fmt.Sprintf("v%d.%d", KubeVersionMajorTesting, KubeVersionMinorTesting) } @@ -112,7 +119,7 @@ func Get() BuildInfo { } // HACK(bacongobbler): strip out GoVersion during a test run for consistent test output - if KubeVersionMajorTesting != 0 && KubeVersionMinorTesting != 0 { + if test.IsTestMode() { v.GoVersion = "" } return v diff --git a/internal/version/version_helmtest.go b/internal/version/version_helmtest.go deleted file mode 100644 index 0354d0985..000000000 --- a/internal/version/version_helmtest.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build helmtest - -/* -Copyright The Helm Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package version - -// This file is only compiled when the `helmtest` build tag is set (applied by -// the Makefile to all test invocations). It seeds the testing-version -// sentinels so that production code paths in this package and in -// pkg/chart/common substitute stable values instead of attempting to read -// build info from a `go test` binary (which has no module info and would -// panic during package init). - -func init() { - KubeVersionMajorTesting = 1 - KubeVersionMinorTesting = 20 -} diff --git a/pkg/chart/common/capabilities.go b/pkg/chart/common/capabilities.go index 135476107..e88f8ad99 100644 --- a/pkg/chart/common/capabilities.go +++ b/pkg/chart/common/capabilities.go @@ -28,6 +28,7 @@ import ( apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" k8sversion "k8s.io/apimachinery/pkg/util/version" + "helm.sh/helm/v4/internal/test" helmversion "helm.sh/helm/v4/internal/version" ) @@ -140,7 +141,7 @@ func makeDefaultCapabilities() (*Capabilities, error) { // Test builds don't include debug info / module info // (And even if they did, we probably want stable capabilities for tests anyway) // Return a default value for test builds - if helmversion.KubeVersionMajorTesting != 0 && helmversion.KubeVersionMinorTesting != 0 { + if test.IsTestMode() { return newCapabilities(helmversion.KubeVersionMajorTesting, helmversion.KubeVersionMinorTesting) } From a1f8db6dec75994d1a2116a8ff06adcce4b31b76 Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Thu, 28 May 2026 18:27:31 +0100 Subject: [PATCH 4/6] Update CONTRIBUTING.md Signed-off-by: Evans Mungai --- CONTRIBUTING.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ffbfaa5a..36990a7a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -236,15 +236,17 @@ docs](https://helm.sh/docs/developers/). Use the Makefile targets (`make test`, `make test-unit`, `make test-coverage`) rather than invoking `go test ./...` directly. The Makefile passes the -`helmtest` build tag, which is required: it activates -`internal/version/version_helmtest.go` to seed testing-version sentinels. Test -binaries have no module info, so without this tag the production code path -attempts to read `k8s.io/client-go`'s version from build info and panics during -package init. +`helmtest` build tag, which is required: it selects +`internal/test/test_mode_on.go` (setting `const testMode = true`), enabling +`test.IsTestMode()` so production code paths in `internal/version` and +`pkg/chart/common` substitute stable values instead of reading build info. +Test binaries have no module info, so without this tag those code paths +panic during package init. If you run tests outside the Makefile (IDE test runners, `go test` directly, custom CI), pass `-tags helmtest`. The tag is omitted from release builds so -the `testing` package and its dependencies stay out of shipped binaries. +the `testing` package and its dependencies stay out of shipped binaries, and +branches gated on `test.IsTestMode()` are dead-code-eliminated by the compiler. ## Pull Requests From 69d923fae9cbcca441a80f035c5669c9f3fceb7a Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Thu, 28 May 2026 18:30:06 +0100 Subject: [PATCH 5/6] Copilot fix Signed-off-by: Evans Mungai --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1254ec374..28d627877 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ format: $(GOIMPORTS) .PHONY: gen-test-golden gen-test-golden: gen-test-golden: PKG = ./pkg/cmd ./pkg/action -gen-test-golden: TESTFLAGS = -update +gen-test-golden: TESTFLAGS += -update gen-test-golden: test-unit # ------------------------------------------------------------------------------ From e45e85824f33b9e86525995156da1e3082a777f9 Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Thu, 28 May 2026 18:46:48 +0100 Subject: [PATCH 6/6] Mode helmtest build flag files to internal/testmode package Signed-off-by: Evans Mungai --- CONTRIBUTING.md | 6 ++-- Makefile | 12 ++++--- internal/test/test.go | 9 ------ .../test_mode_off.go => testmode/mode_off.go} | 2 +- .../test_mode_on.go => testmode/mode_on.go} | 2 +- internal/testmode/testmode.go | 31 +++++++++++++++++++ internal/version/version.go | 6 ++-- pkg/chart/common/capabilities.go | 4 +-- 8 files changed, 48 insertions(+), 24 deletions(-) rename internal/{test/test_mode_off.go => testmode/mode_off.go} (97%) rename internal/{test/test_mode_on.go => testmode/mode_on.go} (97%) create mode 100644 internal/testmode/testmode.go diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 36990a7a9..ed5c2929c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -237,8 +237,8 @@ docs](https://helm.sh/docs/developers/). Use the Makefile targets (`make test`, `make test-unit`, `make test-coverage`) rather than invoking `go test ./...` directly. The Makefile passes the `helmtest` build tag, which is required: it selects -`internal/test/test_mode_on.go` (setting `const testMode = true`), enabling -`test.IsTestMode()` so production code paths in `internal/version` and +`internal/testmode/mode_on.go` (setting `const testMode = true`), enabling +`testmode.IsTestMode()` so production code paths in `internal/version` and `pkg/chart/common` substitute stable values instead of reading build info. Test binaries have no module info, so without this tag those code paths panic during package init. @@ -246,7 +246,7 @@ panic during package init. If you run tests outside the Makefile (IDE test runners, `go test` directly, custom CI), pass `-tags helmtest`. The tag is omitted from release builds so the `testing` package and its dependencies stay out of shipped binaries, and -branches gated on `test.IsTestMode()` are dead-code-eliminated by the compiler. +branches gated on `testmode.IsTestMode()` are dead-code-eliminated by the compiler. ## Pull Requests diff --git a/Makefile b/Makefile index 28d627877..bf78d5511 100644 --- a/Makefile +++ b/Makefile @@ -89,12 +89,14 @@ endif test: test-style test: test-unit -# The `helmtest` build tag activates internal/version/version_helmtest.go, -# which seeds testing-version sentinels so test binaries don't panic reading -# missing module info. Applied to all test invocations. -TESTFLAGS += -tags helmtest - .PHONY: test-unit +# The `helmtest` build tag selects internal/testmode/mode_on.go, flipping +# testmode.IsTestMode() to true so production code paths in internal/version +# and pkg/chart/common substitute stable values instead of reading missing +# module info. Attached to test-unit (not the file-level TESTFLAGS) so the +# tag is guaranteed regardless of any target-specific TESTFLAGS overrides +# in upstream targets (e.g. gen-test-golden). +test-unit: TESTFLAGS += -tags helmtest test-unit: @echo @echo "==> Running unit tests <==" diff --git a/internal/test/test.go b/internal/test/test.go index e3c5b9c68..202e015ab 100644 --- a/internal/test/test.go +++ b/internal/test/test.go @@ -27,15 +27,6 @@ import ( // UpdateGolden writes out the golden files with the latest values, rather than failing the test. var updateGolden = flag.Bool("update", false, "update golden files") -// IsTestMode reports whether the binary was built with -tags helmtest. -// General-purpose signal that the binary was built for tests; consult it -// from production code paths that need to behave differently under test. -// Backed by a compile-time const (see test_mode_on.go / test_mode_off.go) -// so branches gated on it dead-code-eliminate in release builds. -func IsTestMode() bool { - return testMode -} - // TestingT describes a testing object compatible with the critical functions from the testing.T type type TestingT interface { Fatal(...any) diff --git a/internal/test/test_mode_off.go b/internal/testmode/mode_off.go similarity index 97% rename from internal/test/test_mode_off.go rename to internal/testmode/mode_off.go index 62534ed12..ea3e52560 100644 --- a/internal/test/test_mode_off.go +++ b/internal/testmode/mode_off.go @@ -16,6 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -package test +package testmode const testMode = false diff --git a/internal/test/test_mode_on.go b/internal/testmode/mode_on.go similarity index 97% rename from internal/test/test_mode_on.go rename to internal/testmode/mode_on.go index 8a2978699..045d6e2c1 100644 --- a/internal/test/test_mode_on.go +++ b/internal/testmode/mode_on.go @@ -16,6 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -package test +package testmode const testMode = true diff --git a/internal/testmode/testmode.go b/internal/testmode/testmode.go new file mode 100644 index 000000000..a2be02709 --- /dev/null +++ b/internal/testmode/testmode.go @@ -0,0 +1,31 @@ +/* +Copyright The Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package testmode exposes a compile-time test-mode signal that production +// code paths may consult when they need to behave differently in a `go +// test` binary. The package has no imports and no init side effects, so it +// can be safely linked from release builds: branches gated on IsTestMode() +// are dead-code-eliminated by the compiler. +package testmode + +// IsTestMode reports whether the binary was built with -tags helmtest. +// General-purpose signal that the binary was built for tests; consult it +// from production code paths that need to behave differently under test. +// Backed by a compile-time const (see mode_on.go / mode_off.go) so branches +// gated on it dead-code-eliminate in release builds. +func IsTestMode() bool { + return testMode +} diff --git a/internal/version/version.go b/internal/version/version.go index 1259e8437..332b2b652 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -24,7 +24,7 @@ import ( "github.com/Masterminds/semver/v3" - "helm.sh/helm/v4/internal/test" + "helm.sh/helm/v4/internal/testmode" ) var ( @@ -88,7 +88,7 @@ func Get() BuildInfo { // Test builds don't include debug info / module info // (And even if they did, we probably want a stable version during tests anyway) // Return a default value for test builds - if test.IsTestMode() { + if testmode.IsTestMode() { return fmt.Sprintf("v%d.%d", KubeVersionMajorTesting, KubeVersionMinorTesting) } @@ -119,7 +119,7 @@ func Get() BuildInfo { } // HACK(bacongobbler): strip out GoVersion during a test run for consistent test output - if test.IsTestMode() { + if testmode.IsTestMode() { v.GoVersion = "" } return v diff --git a/pkg/chart/common/capabilities.go b/pkg/chart/common/capabilities.go index e88f8ad99..acc288b98 100644 --- a/pkg/chart/common/capabilities.go +++ b/pkg/chart/common/capabilities.go @@ -28,7 +28,7 @@ import ( apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" k8sversion "k8s.io/apimachinery/pkg/util/version" - "helm.sh/helm/v4/internal/test" + "helm.sh/helm/v4/internal/testmode" helmversion "helm.sh/helm/v4/internal/version" ) @@ -141,7 +141,7 @@ func makeDefaultCapabilities() (*Capabilities, error) { // Test builds don't include debug info / module info // (And even if they did, we probably want stable capabilities for tests anyway) // Return a default value for test builds - if test.IsTestMode() { + if testmode.IsTestMode() { return newCapabilities(helmversion.KubeVersionMajorTesting, helmversion.KubeVersionMinorTesting) }