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 <mbuevans@gmail.com>
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 <mbuevans@gmail.com>
Upgrades golang.org/x/net from v0.53.0 to v0.55.0 to fix CVE-2026-39821
(GO-2026-5026), where idna.ToASCII/ToUnicode incorrectly accept Punycode-
encoded labels that decode to ASCII-only labels, enabling privilege escalation
via hostname check bypass.
Coordinated x/ upgrade pulled in by the module graph:
- golang.org/x/sys v0.44.0 => v0.45.0
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Helm v4 shipped on 2025-11-17. Mark it as the current stable release
and v3 as support-mode with its end-of-support dates.
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
The comment describing allowed plugin name characters contained three
U+200B (zero-width space) characters around the '_' and '-' literals.
The rendered comment is identical without them; the ZWSP were likely
copy-pasted from a rich-text source.
Downstream impact: every project that vendors helm.sh/helm/v4 and runs
Renovate gets a repo-wide warning on its Dependency Dashboard about
hidden Unicode characters. Renovate scans the whole tree (including
vendor/) for ZWSP/bidi-override codepoints and cannot be told to skip
a path for this specific check. Removing the characters here clears
the warning everywhere downstream.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
slog.Error on line 157 passes printf-style positional args (%q, %s)
instead of key-value pairs. The slog API treats these as unkeyed
attributes, producing garbled log output.
Two nearby slog.Warn calls wrap fmt.Sprintf unnecessarily. Convert
all three calls to use proper structured key-value arguments.
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Assisted-by: Grok/grok-4
- Close log stream after reading (prevents connection/fd leak)
- Strengthen tests to assert on output headers rather than error paths
- Remove unused import
Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
When a test pod contains multiple containers (e.g. Istio/Consul/Vault
sidecars), 'helm test --logs' failed with 'a container name must be
specified'. This happened because GetPodLogs called the Kubernetes log
API without specifying a container name.
The fix fetches the pod spec first, then iterates over all containers
(init containers + regular containers) and requests logs for each one
explicitly. Errors from individual containers are collected and returned
together via errors.Join rather than aborting on the first failure.
Also fixes a typo: hooksByWight -> hooksByWeight.
Closes#6902
Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
goreleaser v2 has a bug with no_unique_dist_dir where it registers
archive tasks for all sub-arch variants even when constraints limit
builds to one per arch, causing archive collision errors. Switch dist
target to use goreleaser build (binaries only) and create tar.gz/zip
archives manually, copying LICENSE and README.md into each platform
directory to match the existing archive structure.
Add sub-arch constraints (goamd64, goarm64, go386, goriscv64) to ensure
only one variant is built per architecture.
Signed-off-by: Terry Howe <terrylhowe@gmail.com>