mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
feat(hooks): set default deletion policy to before-hook-creation
Signed-off-by: Jacob LeGrone <git@jacob.work>
This commit is contained in:
parent
0227ade173
commit
34d685f8bf
1 changed files with 9 additions and 0 deletions
|
|
@ -40,6 +40,15 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent,
|
|||
sort.Sort(hookByWeight(executingHooks))
|
||||
|
||||
for _, h := range executingHooks {
|
||||
// Set default delete policy to before-hook-creation
|
||||
if h.DeletePolicies == nil || len(h.DeletePolicies) == 0 {
|
||||
// TODO(jlegrone): Only apply before-hook-creation delete policy to run to completion
|
||||
// resources. For all other resource types update in place if a
|
||||
// resource with the same name already exists and is owned by the
|
||||
// current release.
|
||||
h.DeletePolicies = []release.HookDeletePolicy{release.HookBeforeHookCreation}
|
||||
}
|
||||
|
||||
if err := cfg.deleteHookByPolicy(h, release.HookBeforeHookCreation); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue