Alerting: use alerting GrafanaReceiver and BuildReceiverConfiguration in Grafana (#65224)
* replace receiver errors with one from alerting * add the converter to alerting models * update buildReceiverIntegration to accept GrafanaReceiver --------- Co-authored-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
co-authored by
George Robinson
parent
e5e0a1cbbf
commit
afd52d0866
@@ -406,7 +406,7 @@ func statusForTestReceivers(v []notifier.TestReceiverResult) int {
|
||||
for _, next := range receiver.Configs {
|
||||
if next.Error != nil {
|
||||
var (
|
||||
invalidReceiverErr notifier.InvalidReceiverError
|
||||
invalidReceiverErr alertingNotify.InvalidReceiverError
|
||||
receiverTimeoutErr alertingNotify.ReceiverTimeoutError
|
||||
)
|
||||
if errors.As(next.Error, &invalidReceiverErr) {
|
||||
|
||||
@@ -108,7 +108,7 @@ func TestStatusForTestReceivers(t *testing.T) {
|
||||
Name: "test1",
|
||||
UID: "uid1",
|
||||
Status: "failed",
|
||||
Error: notifier.InvalidReceiverError{},
|
||||
Error: alertingNotify.InvalidReceiverError{},
|
||||
}},
|
||||
}, {
|
||||
Name: "test2",
|
||||
@@ -116,7 +116,7 @@ func TestStatusForTestReceivers(t *testing.T) {
|
||||
Name: "test2",
|
||||
UID: "uid2",
|
||||
Status: "failed",
|
||||
Error: notifier.InvalidReceiverError{},
|
||||
Error: alertingNotify.InvalidReceiverError{},
|
||||
}},
|
||||
}}))
|
||||
})
|
||||
@@ -148,7 +148,7 @@ func TestStatusForTestReceivers(t *testing.T) {
|
||||
Name: "test1",
|
||||
UID: "uid1",
|
||||
Status: "failed",
|
||||
Error: notifier.InvalidReceiverError{},
|
||||
Error: alertingNotify.InvalidReceiverError{},
|
||||
}},
|
||||
}, {
|
||||
Name: "test2",
|
||||
@@ -156,7 +156,7 @@ func TestStatusForTestReceivers(t *testing.T) {
|
||||
Name: "test2",
|
||||
UID: "uid2",
|
||||
Status: "failed",
|
||||
Error: notifier.ReceiverTimeoutError{},
|
||||
Error: alertingNotify.ReceiverTimeoutError{},
|
||||
}},
|
||||
}}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user