Fix: Helm chart is removed even if pre-delete hook is failing

Signed-off-by: Imri Barr <imribarr@Imris-MacBook-Pro.local>
pull/13098/head
Imri Barr 1 year ago
parent d1595e701f
commit a978411d23

@ -66,7 +66,6 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent,
StartedAt: helmtime.Now(),
Phase: release.HookPhaseRunning,
}
cfg.recordRelease(rl)
// As long as the implementation of WatchUntilReady does not panic, HookPhaseFailed or HookPhaseSucceeded
// should always be set by this function. If we fail to do that for any reason, then HookPhaseUnknown is
@ -97,6 +96,8 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent,
h.LastRun.Phase = release.HookPhaseSucceeded
}
cfg.recordRelease(rl)
// If all hooks are successful, check the annotation of each hook to determine whether the hook should be deleted
// under succeeded condition. If so, then clear the corresponding resource object in each hook
for _, h := range executingHooks {

Loading…
Cancel
Save