Fixes 48972 - Exposes channels.WebhookMessage (#56140) (#56778)

(cherry picked from commit 26bb139470)

Co-authored-by: Matt <cadnce@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-10-12 05:02:57 -04:00
committed by GitHub
co-authored by Matt
parent 794f9dbb05
commit ffa67c888b
2 changed files with 7 additions and 7 deletions
@@ -115,8 +115,8 @@ func NewWebHookNotifier(config *WebhookConfig, ns notifications.WebhookSender, i
}
}
// webhookMessage defines the JSON object send to webhook endpoints.
type webhookMessage struct {
// WebhookMessage defines the JSON object send to webhook endpoints.
type WebhookMessage struct {
*ExtendedData
// The protocol version.
@@ -153,7 +153,7 @@ func (wn *WebhookNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool
},
as...)
msg := &webhookMessage{
msg := &WebhookMessage{
Version: "1",
ExtendedData: data,
GroupKey: groupKey.String(),
@@ -31,7 +31,7 @@ func TestWebhookNotifier(t *testing.T) {
settings string
alerts []*types.Alert
expMsg *webhookMessage
expMsg *WebhookMessage
expUrl string
expUsername string
expPassword string
@@ -53,7 +53,7 @@ func TestWebhookNotifier(t *testing.T) {
},
expUrl: "http://localhost/test",
expHttpMethod: "POST",
expMsg: &webhookMessage{
expMsg: &WebhookMessage{
ExtendedData: &ExtendedData{
Receiver: "my_receiver",
Status: "firing",
@@ -126,7 +126,7 @@ func TestWebhookNotifier(t *testing.T) {
expHttpMethod: "PUT",
expUsername: "user1",
expPassword: "mysecret",
expMsg: &webhookMessage{
expMsg: &WebhookMessage{
ExtendedData: &ExtendedData{
Receiver: "my_receiver",
Status: "firing",
@@ -191,7 +191,7 @@ func TestWebhookNotifier(t *testing.T) {
},
},
},
expMsg: &webhookMessage{
expMsg: &WebhookMessage{
ExtendedData: &ExtendedData{
Receiver: "my_receiver",
Status: "firing",