Fix nil pointer crash when updating OCI chart dependencies - #11
Merged
Conversation
When dependency_update is enabled and chart dependencies use OCI registries, the downloader.Manager was created without the RegistryClient field set. This caused a nil pointer dereference when the downloader tried to resolve version constraints (like ~1.0.0) that require listing tags from the registry. The fix adds RegistryClient to the Manager initialization in both: - resource_helm_release.go (helm_release resource) - data_helm_template.go (helm_template data source) This allows the downloader to properly authenticate and communicate with OCI registries when fetching chart dependencies. Fixes: panic: runtime error: invalid memory address or nil pointer dereference in helm.sh/helm/v3/pkg/registry.(*Client).Tags
Release notes will be managed manually in CHANGELOG.md
- Add simple migration steps from hashicorp/helm - Add OCI dependency update fix to changes list
schnell3526
force-pushed
the
fix/oci-dependency-update-crash
branch
from
January 31, 2026 14:09
dd1e550 to
d2aa519
Compare
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.
Summary
Backport fix for nil pointer dereference crash when
dependency_updateis enabled with OCI registry charts.Upstream Reference
Problem
When
dependency_updateis enabled and chart dependencies use OCI registries, thedownloader.Managerwas created without theRegistryClientfield set. This causes a nil pointer dereference when the downloader tries to resolve version constraints.Local Verification
Reproduced and verified the fix locally:
docker run -d -p 5001:5000 registry:2)oci://localhost:5001/charts)panic: runtime error: invalid memory address or nil pointer dereferenceatregistry.(*Client).Tags(0x0, ...)terraform plansucceededWhy No Automated Tests
OCI registry integration tests require:
This adds significant CI complexity for a minimal code change (+2 lines). The fix is straightforward and was verified manually.
Changes
helm/resource_helm_release.go: AddRegistryClientto downloader.Managerhelm/data_helm_template.go: AddRegistryClientto downloader.ManagerREADME.md: Add migration guide and update changes listCloses #5