When attaching helm hooks to sub-chart, what is the expected behavior when an upgrade is applied to the umbrella chart?

Viewed 18

When working with a helm super-chart (umbrella chart) that consist of several sub-charts:

1 / if we attach a post-upgrade hook to one of the sub-chart, I wonder what is the expected behavior when running helm upgrade on the super-chart ?

1 - a / Assuming the sub-chart that contains the hooks has no changes at all, and there are changes in other sub-charts that do not have the hooks. Is the post-upgrade hooks supposed to be executed even tho, the sub-chart has no changes at all ?

Here is why i am asking the question:

  • In my understanding hooks are associated to release, and sub-charts do not have their own release but are part of the umbrella chart release. Hence, a post-upgrade hook should be executed only, if the chart of the release changed and an upgrade is actually applied. By that reasoning it would mean that (1) either hooks should only be attached to the umbrella chart which has a release, (2) or if attached to a sub-charts and it works nonetheless, then the hooks would be fired anytime the upgrade command is applied on the super charts. In other words, there would be no way to say, run the hooks from that sub-chart, only if that sub-chart changes. That is, the super-chart which is the only chart that yield a release, can be subject to an upgrade, whenever any of its sub-chart changes. If hooks are indeed strictly associated to release, even if that hooks is located in a sub-chart, it would get triggered whenever the release to which the sub-chart is part of is upgraded.

  • So far in our experiment we have attached the hooks that are related to specific sub-chart in the super chart. It works but it is annoying, because they are executed all the time, even when the associated sub-chart did not change. We would to change it and attach it to the sub-chart. However the spec does not say what is the expected behavior, hence the question, so if/when experimenting, we would know if the behavior that comes out, is the expected one or the result of configuring something the wrong way.

0 Answers
Related