From 385c3e80ef40dfcd15e82fee8c5f31a2b0f5988f Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Mon, 19 Sep 2022 02:28:11 +0000 Subject: [PATCH] Add documentation about the new preapply hook Signed-off-by: Yusuke Kuoka --- docs/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 2ed5226c..887cd839 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1193,9 +1193,12 @@ Currently supported `events` are: Hooks associated to `prepare` events are triggered after each release in your helmfile is loaded from YAML, before execution. `prepare` hooks are triggered on the release as long as it is not excluded by the helmfile selector(e.g. `helmfile -l key=value`). -Hooks associated to `presync` events are triggered before each release is applied to the remote cluster. +Hooks associated to `presync` events are triggered before each release is installed or upgraded on the remote cluster. This is the ideal event to execute any commands that may mutate the cluster state as it will not be run for read-only operations like `lint`, `diff` or `template`. +`preapply` hooks are triggered before a release is uninstalled, installed, or upgraded as part of `helmfile apply`. +This is the ideal event to hook into when you are going to use `helmfile apply` for every kind of change, and you want the hook to be called only when any kind of change is being made. + `preuninstall` hooks are triggered immediately before a release is uninstalled as part of `helmfile apply`, `helmfile sync`, `helmfile delete`, and `helmfile destroy`. `postuninstall` hooks are triggered immediately after successful uninstall of a release while running `helmfile apply`, `helmfile sync`, `helmfile delete`, `helmfile destroy`.