flant / shell-operator

Shell-operator is a tool for running event-driven scripts in a Kubernetes cluster
https://flant.github.io/shell-operator/
Apache License 2.0
2.44k stars 214 forks source link

add IgnoreHookError patch option #538

Closed miklezzzz closed 1 year ago

miklezzzz commented 1 year ago

Overview

This PR adds additional patch_option for Filter/Patch operations named IgnoreHookError and some execution logic around it.

What this PR does / why we need it

If IgnoreHookError is set to true for a Filter/Patch operation and WithSubresource equals to /status, such an operation will be applied even in case of the hook failure. It can come in handy in a situation when a hook operates around some kubernetes resource and one wants to make it more obvious when the resource was noticied/processed/etc by the hook last time by means of status fields.

This way we could provide some meaningful statuses or a feedback loop on what happens when a hook is executed.

Special notes for your reviewer