mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
feat: Add option to mute alerts generated from webhooks
Signed-off-by: Mayank Shah <mayankshah1614@gmail.com>
This commit is contained in:
@@ -941,6 +941,9 @@ spec:
|
||||
- event
|
||||
- rollback
|
||||
- confirm-traffic-increase
|
||||
muteAlert:
|
||||
description: Mute all alerts for the webhook
|
||||
type: boolean
|
||||
url:
|
||||
description: URL address of this webhook
|
||||
type: string
|
||||
|
||||
@@ -941,6 +941,9 @@ spec:
|
||||
- event
|
||||
- rollback
|
||||
- confirm-traffic-increase
|
||||
muteAlert:
|
||||
description: Mute all alerts for the webhook
|
||||
type: boolean
|
||||
url:
|
||||
description: URL address of this webhook
|
||||
type: string
|
||||
|
||||
@@ -329,6 +329,9 @@ type CanaryWebhook struct {
|
||||
// URL address of this webhook
|
||||
URL string `json:"url"`
|
||||
|
||||
// MuteAlert mutes all alerts generated from this webhook, if any
|
||||
MuteAlert bool `json:"muteAlert"`
|
||||
|
||||
// Request timeout for this webhook
|
||||
Timeout string `json:"timeout,omitempty"`
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ func (c *Controller) runConfirmTrafficIncreaseHooks(canary *flaggerv1.Canary) bo
|
||||
if err != nil {
|
||||
c.recordEventWarningf(canary, "Halt %s.%s advancement waiting for traffic increase approval %s",
|
||||
canary.Name, canary.Namespace, webhook.Name)
|
||||
c.alert(canary, "Canary traffic increase is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
if !webhook.MuteAlert {
|
||||
c.alert(canary, "Canary traffic increase is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
}
|
||||
return false
|
||||
}
|
||||
c.recordEventInfof(canary, "Confirm-traffic-increase check %s passed", webhook.Name)
|
||||
@@ -50,7 +52,9 @@ func (c *Controller) runConfirmRolloutHooks(canary *flaggerv1.Canary, canaryCont
|
||||
}
|
||||
c.recordEventWarningf(canary, "Halt %s.%s advancement waiting for approval %s",
|
||||
canary.Name, canary.Namespace, webhook.Name)
|
||||
c.alert(canary, "Canary is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
if !webhook.MuteAlert {
|
||||
c.alert(canary, "Canary is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
}
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
@@ -79,7 +83,9 @@ func (c *Controller) runConfirmPromotionHooks(canary *flaggerv1.Canary, canaryCo
|
||||
}
|
||||
c.recordEventWarningf(canary, "Halt %s.%s advancement waiting for promotion approval %s",
|
||||
canary.Name, canary.Namespace, webhook.Name)
|
||||
c.alert(canary, "Canary promotion is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
if !webhook.MuteAlert {
|
||||
c.alert(canary, "Canary promotion is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
}
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user