mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Include cluster name in all alerts
Signed-off-by: ashokhein <ashokhein@gmail.com>
This commit is contained in:
+12
-11
@@ -73,8 +73,18 @@ func (c *Controller) sendEventToWebhook(r *flaggerv1.Canary, eventType, template
|
||||
|
||||
func (c *Controller) alert(canary *flaggerv1.Canary, message string, metadata bool, severity flaggerv1.AlertSeverity) {
|
||||
var fields []notifier.Field
|
||||
|
||||
if c.clusterName != "" {
|
||||
fields = append(fields,
|
||||
notifier.Field{
|
||||
Name: "Cluster",
|
||||
Value: c.clusterName,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if metadata {
|
||||
fields = alertMetadata(canary, c.clusterName)
|
||||
fields = alertMetadata(canary)
|
||||
}
|
||||
|
||||
// send alert with the global notifier
|
||||
@@ -173,18 +183,9 @@ func (c *Controller) alert(canary *flaggerv1.Canary, message string, metadata bo
|
||||
}
|
||||
}
|
||||
|
||||
func alertMetadata(canary *flaggerv1.Canary, cluster string) []notifier.Field {
|
||||
func alertMetadata(canary *flaggerv1.Canary) []notifier.Field {
|
||||
var fields []notifier.Field
|
||||
|
||||
if cluster != "" {
|
||||
fields = append(fields,
|
||||
notifier.Field{
|
||||
Name: "Cluster",
|
||||
Value: cluster,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fields = append(fields,
|
||||
notifier.Field{
|
||||
Name: "Target",
|
||||
|
||||
Reference in New Issue
Block a user