Fix nil pointer crash when updating OCI chart dependencies - #1726
Open
efoncubierta wants to merge 1 commit into
Open
Fix nil pointer crash when updating OCI chart dependencies#1726efoncubierta wants to merge 1 commit into
efoncubierta wants to merge 1 commit into
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
This was referenced Jan 31, 2026
Merged
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. This fix only adds the already-configured
RegistryClientto the downloader Manager, enabling existing authentication to work correctly.Description
When dependency_update is enabled and chart dependencies use OCI registries, the
downloader.Managerwas created without theRegistryClientfield set. This caused a nil pointer dereference when the downloader tried to resolve version constraints (such as~1.0.0) that require listing tags from the registry.The fix adds
RegistryClientto the Manager initialization in both:resource_helm_release.godata_helm_template.goThis allows the downloader to properly authenticate and communicate with OCI registries when fetching chart dependencies.
Error before the fix:
Acceptance tests
~1.0.0and>=1.0.0 <2.0.0registriesblock for authentication (oci://registry.gitlab.com)dependency_update = trueinhelm_releaseresourceRelease Note
Release note for CHANGELOG:
References
This issue affects users who:
oci://registry.gitlab.com)dependency_update = truein their helm_release resourceChart.yamldependencies (e.g., ~1.0.0, >=1.0.0)Community Note