flagger icon indicating copy to clipboard operation
flagger copied to clipboard

Split `post-rollout` webhook into two different webhooks for success and failure

Open aryan9600 opened this issue 3 years ago • 1 comments

Describe the feature

We currently have the post-rollout webhook, which runs if a canary analysis passes or fails. But it can be useful to have a webhook that just executes if a canary passes and similarly a webhook that executes only if a canary fails.

Proposed solution

  • Deprecate the post-rollout hook.
  • Introduce two new webhook types: success and failure
  • Run success webhooks when a canary passes and failure webhooks when a canary fails; if the spec defines post-rollout webhook(s), then run them when a canary passes or fails.

aryan9600 avatar Apr 19 '22 20:04 aryan9600

+1

timonbimon avatar Aug 18 '22 07:08 timonbimon

This is something I did run into lately too. Currently flagger webhooks doesn't provide a way to run after successful promotion. In my case I want to trigger cache purge only if rollout ended successfully and the feature request above covers that.

justinaslelys avatar Oct 05 '22 11:10 justinaslelys

+1

rp-jair-junior avatar Jul 05 '23 20:07 rp-jair-junior

the webhook payload contains a field phase that contains the phase of the canary run. for the post-rollout webhook, the phase will be Succeeded if the run succeeded, or Failed if it failed. users can read the value of phase and execute logic accordingly. hence, this "enhancement" is not required.

aryan9600 avatar Jul 05 '23 20:07 aryan9600

Hi @aryan9600 , thanks for your answer. Do you have some example ?

rp-jair-junior avatar Jul 06 '23 13:07 rp-jair-junior