roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.04k stars 565 forks source link

Cleanup hook fired at the beginning instead of at the end when using nested states #2146

Open teksuo opened 2 years ago

teksuo commented 2 years ago

Operating system

Ubuntu 22 & Manjaro

Helmfile Version

0.144.0

Helm Version

3.9.0

Bug description

I have a helmfile with a global "cleanup" hook and a "postsync" and "postuninstall" hook per-release. Everything works like a charm for both "sync" and "destroy" commands and the "cleanup" hook is always executed after all the releases have been processed.

However, when I start using nested states, the global "cleanup" hook for the "destroy" command gets executed at the beginning of the process, right after logging into the registry.

I honestly don't understand this behavior and I don't see it documented anywhere.

Any insight will be welcome,

Thanks in advance

Steps to reproduce

https://github.com/teksuo/helmfile-nested-hook-bug