-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/Proposal: Accept hook names in helm.sh/hook-delete-policy #3128
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@bacongobbler any chance of getting some eyes on this? |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Currently, you can easily delete a hook resource immediately after its execution:
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-delete-policy": hook-failed
Or, though this is currently missing in the docs at docs/charts_hooks.md:
"helm.sh/hook-delete-policy": "hook-succeeded,hook-failed"
(according to comments in #2692)
However, it's a pretty common case to want to delete the resource later - most often, on running
helm delete
(which otherwise does not delete hook resources).This is addressed in the documentation here, but the proposed workaround is painful: Users need to create some container image to do resource deletion, package it into a Job, and make that Job a hook. In practice, this leads to issues like #2777.
Proposal: support the specification of hook names (e.g.
post-install,pre-delete,post-delete
) which would do the deletion during the named hook.The downside to specifying these in
"helm.sh/hook-delete-policy"
is that there would be no good way to specify a weight. It could always use 0, or some high weight to always go "last" (since the deletion is an async clean-up operation, it probably doesn't make sense to rely on it being scheduled "before" anything else). Or, we could add some new field(s) to more properly support hook specification.I expect this could be tricky to implement and might be more properly addressed with Stages (#2243), but that looks like it might not happen/be a long ways off.
The text was updated successfully, but these errors were encountered: