Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Adds support for container lifecycle hooks which serve different use cases than helm hooks and can be more reliable for similar use cases (e.g. for changes outside of helm management like a pod or statefulset being deleted).
Special notes for your reviewer:
My use case requires a sophisticated postStart hook with variable interpolation from a parent chart, but I figured many users of this chart may not use it as a subchart, so I included the option to pass in simple container hooks via values, as well. I tried to make this opaque to the user so they could just use
.Values.lifecycle
in both cases, but I couldn't figure out how to get helm to differentiate between a template and a values map since both aremap
types. So I wound up supporting both use cases with.Values.lifecycle
and.Values.lifecycleTemplate
.Furthermore, following the same pattern, I also added
.Values.extraEnv
and.Values.extraEnvTemplate
to support passing secrets to the hooks.Checklist
I get the following error when trying to run
make test
. Not sure if this is an existing issue, but it looks unrelated to the changes in this PR.