Skip to content

fix: cleanup hooks not receiving error signal#2475

Open
yxxhero wants to merge 2 commits intomainfrom
fix-cleanup-hooks-error-signal
Open

fix: cleanup hooks not receiving error signal#2475
yxxhero wants to merge 2 commits intomainfrom
fix-cleanup-hooks-error-signal

Conversation

@yxxhero
Copy link
Member

@yxxhero yxxhero commented Mar 9, 2026

Summary

  • Fixes .Event.Error is not populated for cleanup global hooks #1041 by propagating errors to cleanup global hooks
  • Changes withPreparedCharts callback signature from func() to func() []error
  • Modifies TriggerGlobalCleanupEvent to accept an error parameter
  • Updates all callback invocations to return errors

This fix ensures that .Event.Error is properly populated for cleanup global hooks when releases fail, matching the behavior already present for postsync release hooks.

Changes

  1. pkg/app/run.go: Modified withPreparedCharts to capture errors from the callback and pass the first error to TriggerGlobalCleanupEvent

  2. pkg/state/state.go: Updated TriggerGlobalCleanupEvent to accept an evtErr error parameter

  3. pkg/app/app.go: Updated all callback functions to return []error

Test Plan

  • Build compiles successfully
  • make check passes

References

Closes #1041

Signed-off-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Closes #1041

Signed-off-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
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.

.Event.Error is not populated for cleanup global hooks

1 participant