Fix nil pointer crash when updating OCI chart dependencies #1726
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