Skip to content

Fix nil pointer crash when updating OCI chart dependencies - #1746

Closed
schnell3526 wants to merge 15 commits into
hashicorp:mainfrom
schnell3526:fix/oci-dependency-update-crash
Closed

Fix nil pointer crash when updating OCI chart dependencies#1746
schnell3526 wants to merge 15 commits into
hashicorp:mainfrom
schnell3526:fix/oci-dependency-update-crash

Conversation

@schnell3526

Copy link
Copy Markdown

Summary

Backport fix for nil pointer dereference crash when dependency_update is enabled with OCI registry charts.

  • Fix nil pointer crash in OCI chart dependency resolution
  • Add migration guide to README
  • Update changes from upstream list

Upstream Reference

Problem

When dependency_update is enabled and chart dependencies use OCI registries, the downloader.Manager was created without the RegistryClient field set. This causes a nil pointer dereference when the downloader tries to resolve version constraints.

Changes

  • helm/resource_helm_release.go: Add RegistryClient to downloader.Manager
  • helm/data_helm_template.go: Add RegistryClient to downloader.Manager
  • README.md: Add migration guide and update changes list

Closes #5

schnell3526 and others added 15 commits January 31, 2026 20:07
Remove workflows that are specific to HashiCorp's internal tooling:
- build.yml (replaced by GoReleaser)
- changelog-checker.yml
- hc-copywrite.yml
- issue-comment-created.yml
- issue-opened.yml
- jira-issues.yml
- jira-pr.yml
- website.yaml

Also remove .release/ directory (HashiCorp CRT config).
This workflow requires HashiCorp's self-hosted runner (custom-linux-medium)
which is not available in this fork.
feat: Add GoReleaser configuration and update module paths to schnell…
Fix issues in acceptance tests added by upstream PR hashicorp#1734:

1. TestAccResourceRelease_updateExistingFailed:
   - Fix expected revision from "3" to "4" since each failed upgrade
     (Step 2 and Step 3) increments the Helm revision

2. TestAccResourceRelease_statePreservedDuringRefresh:
   - Remove Config from RefreshState step as terraform-plugin-testing
     does not allow Config and RefreshState in the same TestStep

3. TestAccResourceRelease_refreshPreservesFailedState:
   - Same fix: Remove Config from RefreshState step
The status attribute returns lowercase "failed", not uppercase "FAILED".
Use the Helm SDK constant for consistency with other tests.
fix(helm_release): Preserve Terraform state on failed Helm operations
- Add explanation of why this fork exists
- Add installation instructions with schnell3526/helm source
- List changes from upstream (state deletion bug fix)
- Add roadmap with Helm v4 support planned
- Update badges to point to this repository
docs: Update README for community fork
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
schnell3526 requested a review from a team as a code owner January 31, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants