Skip to content

Fix nil Reason panic in chartutil#1223

Open
immanuwell wants to merge 1 commit into
fluxcd:mainfrom
immanuwell:fix/chartutil-nil-reason-error
Open

Fix nil Reason panic in chartutil#1223
immanuwell wants to merge 1 commit into
fluxcd:mainfrom
immanuwell:fix/chartutil-nil-reason-error

Conversation

@immanuwell
Copy link
Copy Markdown

@immanuwell immanuwell commented May 29, 2026

ErrValuesReference.Error() dereferences Reason even though type docs say a nil Reason should behave like ErrUnknown.
So (&chartutil.ErrValuesReference{}).Error() blows up

This patch falls back to ErrUnknown when Reason is nil and adds a regression test for zero-value and wrapped-error cases.

Repro
go test ./... -run TestErrValuesReferenceErrorNilReason

Checks
make test-chartutil

Honor the documented ErrUnknown fallback when ErrValuesReference
has a nil Reason.

Add a regression test for zero-value and wrapped-error cases so
formatting the exported error type does not panic.

Signed-off-by: immanuwell <pchpr.00@list.ru>
Assisted-by: codex/gpt-5
@immanuwell immanuwell requested a review from a team as a code owner May 29, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant