Migrate to Helm v4 SDK - #1873
Open
dennismdejong wants to merge 3 commits into
Open
Conversation
Bump helm.sh/helm from v3 to v4 (v4.2.3) and adapt the provider to the Helm v4 SDK breaking changes: - Update all import paths from helm.sh/helm/v3 to helm.sh/helm/v4 - Upgrade k8s.io dependencies to v0.36.1 - Add compat_v4.go shims for chartutil and releaseutil packages removed in Helm v4 (ParseKubeVersion, SplitManifests, dependency conversion) - Add postrender_exec.go to preserve binary-path post-renderer support (postrender.NewExec was removed in Helm v4) - Adapt action fields: * Wait bool -> WaitStrategy (kube.WaitStrategy) * WaitForJobs -> handled by StatusWatcherStrategy * Atomic -> RollbackOnFailure * Force/ForceUpdate -> ForceReplace * DryRun -> DryRunStrategy * ClientOnly -> DryRunStrategy * Remove Recreate (removed in Helm v4) - Type-assert loader.Load results (chart.Charter) to *v2.Chart - Type-assert Run() results (release.Releaser) to *v1.Release - actionConfig.Init no longer accepts a logging callback - Update test helpers (kube.GetConfig -> ConfigFlags, StatusDeployed -> release/common) and status action fields - Add CHANGELOG entry for the Helm v4 migration Fixes hashicorp#1730 and hashicorp#1792
dennismdejong
requested review from
a team,
iam404 and
rigalGit
as code owners
August 20, 2026 17:55
- postrender: update expected error pattern for Helm v4 YAML parsing error - invalidName: update expected error pattern for Helm v4 release name validation - LintFailChart: update expected error pattern for Helm v4 lint output - ModifyPlan: preserve prior metadata when no relevant attributes change to avoid spurious diffs under Helm v4 server-side apply
- Add needsPlainHTTP helper to enable plain-HTTP (non-TLS) for local OCI registries (localhost/127.0.0.1), fixing OCI pulls against local registries - Create a dedicated plain-HTTP registry client (with the shared credentials file) for local OCI registries so login credentials are shared with pulls - Fix valuesUnknown to check set_list values (was reading plan.Set twice) - Strip metadata.generation in normalizeK8sObject to avoid spurious resource diffs under Helm v4 server-side apply - Map force_update to ForceConflicts (not ForceReplace) since ForceReplace cannot be combined with server-side apply in Helm v4 - Update test helpers to prefer podman over docker for the OCI test registry - Update acceptance test error patterns and drift checks for Helm v4 behavior All acceptance tests now pass against a live minikube cluster (podman driver).
Author
Acceptance test resultsAll acceptance tests now pass against a live Kubernetes cluster (minikube v1.38.1 with the podman driver, Kubernetes v1.35.1). Ran the full What was validated
Notable fixes made during test validation
|
Author
|
Correction to the previous comment (the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
No changes to security controls.
Description
This PR migrates the provider from the Helm v3 SDK (
helm.sh/helm/v3) to the Helm v4 SDK (helm.sh/helm/v4v4.2.3), resolving issues #1730 and #1792.What changed
helm.sh/helm/v3→helm.sh/helm/v4v4.2.3;k8s.iodeps upgraded to v0.36.1helm.sh/helm/v3/...imports updated tohelm.sh/helm/v4/...across 6 source files + testschartutil,releaseutil,pkg/repo,pkg/postrenderno longer exist in v4:helm/compat_v4.goshims forParseKubeVersion,SplitManifests, and dependency conversionhelm/postrender_exec.goto preserve binary-path post-renderer support (v3'spostrender.NewExecwas removed)Waitbool →WaitStrategy(kube.WaitStrategy)WaitForJobs→ handled byStatusWatcherStrategyAtomic→RollbackOnFailureForce/ForceUpdate→ForceReplaceDryRun→DryRunStrategyClientOnly→DryRunStrategyRecreate(removed in Helm v4)loader.Loadreturnschart.Charter(→*v2.Chart); actionRun()returnsrelease.Releaser(→*v1.Release)actionConfig.Initno longer accepts a logging callbackkube.GetConfig→ConfigFlags,StatusDeployed→release/common, status action fields)Breaking changes for users
postrenderbinary executables are deprecated in favor of Helm v4 plugins (still supported via compat layer)recreate_podsis no longer supportedAcceptance tests
(Note: This is a large migration. Acceptance tests require a live Kubernetes cluster and were not run here; the code compiles and passes
go vet.)Release Note
References
Fixes #1730, Fixes #1792
Community Note