Skip to content

Commit 19fe320

Browse files
idsulikmattfarina
authored andcommitted
fix(hooks): correct hooks delete order
Signed-off-by: Suleiman Dibirov <[email protected]> (cherry picked from commit f4f4a6b)
1 parent 4fcc5c2 commit 19fe320

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/action/hooks.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent,
9999

100100
// If all hooks are successful, check the annotation of each hook to determine whether the hook should be deleted
101101
// under succeeded condition. If so, then clear the corresponding resource object in each hook
102-
for _, h := range executingHooks {
102+
for i := len(executingHooks) - 1; i >= 0; i-- {
103+
h := executingHooks[i]
103104
if err := cfg.deleteHookByPolicy(h, release.HookSucceeded, timeout); err != nil {
104105
return err
105106
}

0 commit comments

Comments
 (0)