Fixes 48972 - Exposes channels.WebhookMessage (#56140)

This commit is contained in:
Matt 2022-10-12 19:50:28 +11:00 committed by GitHub
parent 45edce90d3
commit 26bb139470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -123,8 +123,8 @@ func buildWebhookNotifier(factoryConfig FactoryConfig) (*WebhookNotifier, error)
}, nil
}
// 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.
@ -161,7 +161,7 @@ func (wn *WebhookNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool
},
as...)
msg := &webhookMessage{
msg := &WebhookMessage{
Version: "1",
ExtendedData: data,
GroupKey: groupKey.String(),

View File

@ -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",