From 9fecabf1f726b28576c4c5b53900ca0dee83a96c Mon Sep 17 00:00:00 2001 From: cubicroot Date: Sun, 24 Apr 2022 16:58:40 +0200 Subject: [PATCH] fix typos --- internal/model/alertmanager.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/model/alertmanager.go b/internal/model/alertmanager.go index 2d6a408..9013cea 100644 --- a/internal/model/alertmanager.go +++ b/internal/model/alertmanager.go @@ -8,17 +8,17 @@ type AlertmanagerWebhook struct { Receiver string `json:"receiver"` GroupLabels map[string]string `json:"groupLabels"` CommonLabels map[string]string `json:"commonLabels"` - CommonAnnotations map[string]string `json:"commonAnnotiations"` + CommonAnnotations map[string]string `json:"commonAnnotations"` ExternalURL string `json:"externalURL"` Alerts []AlertmanagerAlert `json:"alerts"` } type AlertmanagerAlert struct { - Labels map[string]string `json:"labels"` - Annotiations map[string]string `json:"annotiations"` - StartsAt string `json:"startsAt"` - EndsAt string `json:"endsAt"` - Status string `json:"status"` + Labels map[string]string `json:"labels"` + Annotations map[string]string `json:"annotations"` + StartsAt string `json:"startsAt"` + EndsAt string `json:"endsAt"` + Status string `json:"status"` } func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotation string) Notification { @@ -35,7 +35,7 @@ func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotatio message.WriteString(alert.Status) message.WriteString("\n\n") - if titleString, ok := alert.Annotiations[titleAnnotation]; ok { + if titleString, ok := alert.Annotations[titleAnnotation]; ok { title.WriteString(titleString) } else if titleString, ok := alert.Labels[titleAnnotation]; ok { title.WriteString(titleString) @@ -43,7 +43,7 @@ func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotatio title.WriteString("Unknown Title") } - if messageString, ok := alert.Annotiations[messageAnnotation]; ok { + if messageString, ok := alert.Annotations[messageAnnotation]; ok { message.WriteString(messageString) } else if messageString, ok := alert.Labels[messageAnnotation]; ok { message.WriteString(messageString)