mirror of https://github.com/grafana/grafana.git
Alerting: Update grafana/alerting. (#88914)
This commit is contained in:
parent
2173429ce2
commit
dd3c3b5857
2
go.mod
2
go.mod
|
@ -86,7 +86,7 @@ require (
|
||||||
github.com/googleapis/gax-go/v2 v2.12.3 // @grafana/grafana-backend-group
|
github.com/googleapis/gax-go/v2 v2.12.3 // @grafana/grafana-backend-group
|
||||||
github.com/gorilla/mux v1.8.1 // @grafana/grafana-backend-group
|
github.com/gorilla/mux v1.8.1 // @grafana/grafana-backend-group
|
||||||
github.com/gorilla/websocket v1.5.0 // @grafana/grafana-app-platform-squad
|
github.com/gorilla/websocket v1.5.0 // @grafana/grafana-app-platform-squad
|
||||||
github.com/grafana/alerting v0.0.0-20240606211712-071c8609797a // @grafana/alerting-backend
|
github.com/grafana/alerting v0.0.0-20240607182251-835aff588914 // @grafana/alerting-backend
|
||||||
github.com/grafana/authlib v0.0.0-20240611075137-331cbe4e840f // @grafana/identity-access-team
|
github.com/grafana/authlib v0.0.0-20240611075137-331cbe4e840f // @grafana/identity-access-team
|
||||||
github.com/grafana/codejen v0.0.3 // @grafana/dataviz-squad
|
github.com/grafana/codejen v0.0.3 // @grafana/dataviz-squad
|
||||||
github.com/grafana/cuetsy v0.1.11 // @grafana/grafana-as-code
|
github.com/grafana/cuetsy v0.1.11 // @grafana/grafana-as-code
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -2305,8 +2305,8 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
|
||||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/grafana/alerting v0.0.0-20240606211712-071c8609797a h1:MvrEgxNxmUqaFWkBtRlbgxStbdD8FcmtjlRp98bmMJU=
|
github.com/grafana/alerting v0.0.0-20240607182251-835aff588914 h1:WXLbSnnomltxdNcE20CI8RD8quZ/L0YpXP0WK+0S1BU=
|
||||||
github.com/grafana/alerting v0.0.0-20240606211712-071c8609797a/go.mod h1:U7Ta3K4T7jVgqGSYuPsfuPKHFiL2GbCZSHa3nHjmCos=
|
github.com/grafana/alerting v0.0.0-20240607182251-835aff588914/go.mod h1:U7Ta3K4T7jVgqGSYuPsfuPKHFiL2GbCZSHa3nHjmCos=
|
||||||
github.com/grafana/authlib v0.0.0-20240611075137-331cbe4e840f h1:hvRCAv+TgcHu3i/Sd7lFJx84iEtgzDCYuk7OWeXatD0=
|
github.com/grafana/authlib v0.0.0-20240611075137-331cbe4e840f h1:hvRCAv+TgcHu3i/Sd7lFJx84iEtgzDCYuk7OWeXatD0=
|
||||||
github.com/grafana/authlib v0.0.0-20240611075137-331cbe4e840f/go.mod h1:+MjD5sxxgLOIvw0ox18wJmjBzz8tOECo7quiiZAmgJY=
|
github.com/grafana/authlib v0.0.0-20240611075137-331cbe4e840f/go.mod h1:+MjD5sxxgLOIvw0ox18wJmjBzz8tOECo7quiiZAmgJY=
|
||||||
github.com/grafana/codejen v0.0.3 h1:tAWxoTUuhgmEqxJPOLtJoxlPBbMULFwKFOcRsPRPXDw=
|
github.com/grafana/codejen v0.0.3 h1:tAWxoTUuhgmEqxJPOLtJoxlPBbMULFwKFOcRsPRPXDw=
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
|
|
||||||
"github.com/grafana/alerting/definition"
|
"github.com/grafana/alerting/definition"
|
||||||
|
alertingmodels "github.com/grafana/alerting/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// swagger:route POST /alertmanager/grafana/config/api/v1/alerts alertmanager RoutePostGrafanaAlertingConfig
|
// swagger:route POST /alertmanager/grafana/config/api/v1/alerts alertmanager RoutePostGrafanaAlertingConfig
|
||||||
|
@ -545,15 +546,15 @@ type AlertGroups = amv2.AlertGroups
|
||||||
|
|
||||||
type AlertGroup = amv2.AlertGroup
|
type AlertGroup = amv2.AlertGroup
|
||||||
|
|
||||||
type Receiver = amv2.Receiver
|
type Receiver = alertingmodels.Receiver
|
||||||
|
|
||||||
// swagger:response receiversResponse
|
// swagger:response receiversResponse
|
||||||
type ReceiversResponse struct {
|
type ReceiversResponse struct {
|
||||||
// in:body
|
// in:body
|
||||||
Body []amv2.Receiver
|
Body []alertingmodels.Receiver
|
||||||
}
|
}
|
||||||
|
|
||||||
type Integration = amv2.Integration
|
type Integration = alertingmodels.Integration
|
||||||
|
|
||||||
// swagger:parameters RouteGetAMAlerts RouteGetAMAlertGroups RouteGetGrafanaAMAlerts RouteGetGrafanaAMAlertGroups
|
// swagger:parameters RouteGetAMAlerts RouteGetAMAlertGroups RouteGetGrafanaAMAlerts RouteGetGrafanaAMAlertGroups
|
||||||
type AlertsParams struct {
|
type AlertsParams struct {
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
// Code generated by mockery v2.42.1. DO NOT EDIT.
|
// Code generated by mockery v2.43.2. DO NOT EDIT.
|
||||||
|
|
||||||
package alertmanager_mock
|
package alertmanager_mock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
|
||||||
|
alertingmodels "github.com/grafana/alerting/models"
|
||||||
|
|
||||||
definitions "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
definitions "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||||
|
|
||||||
mock "github.com/stretchr/testify/mock"
|
mock "github.com/stretchr/testify/mock"
|
||||||
|
|
||||||
models "github.com/grafana/grafana/pkg/services/ngalert/models"
|
models "github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||||
|
@ -308,23 +311,23 @@ func (_c *AlertmanagerMock_GetAlerts_Call) RunAndReturn(run func(context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetReceivers provides a mock function with given fields: ctx
|
// GetReceivers provides a mock function with given fields: ctx
|
||||||
func (_m *AlertmanagerMock) GetReceivers(ctx context.Context) ([]v2models.Receiver, error) {
|
func (_m *AlertmanagerMock) GetReceivers(ctx context.Context) ([]alertingmodels.Receiver, error) {
|
||||||
ret := _m.Called(ctx)
|
ret := _m.Called(ctx)
|
||||||
|
|
||||||
if len(ret) == 0 {
|
if len(ret) == 0 {
|
||||||
panic("no return value specified for GetReceivers")
|
panic("no return value specified for GetReceivers")
|
||||||
}
|
}
|
||||||
|
|
||||||
var r0 []v2models.Receiver
|
var r0 []alertingmodels.Receiver
|
||||||
var r1 error
|
var r1 error
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) ([]v2models.Receiver, error)); ok {
|
if rf, ok := ret.Get(0).(func(context.Context) ([]alertingmodels.Receiver, error)); ok {
|
||||||
return rf(ctx)
|
return rf(ctx)
|
||||||
}
|
}
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) []v2models.Receiver); ok {
|
if rf, ok := ret.Get(0).(func(context.Context) []alertingmodels.Receiver); ok {
|
||||||
r0 = rf(ctx)
|
r0 = rf(ctx)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
if ret.Get(0) != nil {
|
||||||
r0 = ret.Get(0).([]v2models.Receiver)
|
r0 = ret.Get(0).([]alertingmodels.Receiver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,12 +358,12 @@ func (_c *AlertmanagerMock_GetReceivers_Call) Run(run func(ctx context.Context))
|
||||||
return _c
|
return _c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_c *AlertmanagerMock_GetReceivers_Call) Return(_a0 []v2models.Receiver, _a1 error) *AlertmanagerMock_GetReceivers_Call {
|
func (_c *AlertmanagerMock_GetReceivers_Call) Return(_a0 []alertingmodels.Receiver, _a1 error) *AlertmanagerMock_GetReceivers_Call {
|
||||||
_c.Call.Return(_a0, _a1)
|
_c.Call.Return(_a0, _a1)
|
||||||
return _c
|
return _c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_c *AlertmanagerMock_GetReceivers_Call) RunAndReturn(run func(context.Context) ([]v2models.Receiver, error)) *AlertmanagerMock_GetReceivers_Call {
|
func (_c *AlertmanagerMock_GetReceivers_Call) RunAndReturn(run func(context.Context) ([]alertingmodels.Receiver, error)) *AlertmanagerMock_GetReceivers_Call {
|
||||||
_c.Call.Return(run)
|
_c.Call.Return(run)
|
||||||
return _c
|
return _c
|
||||||
}
|
}
|
||||||
|
@ -726,6 +729,10 @@ func (_c *AlertmanagerMock_SaveAndApplyDefaultConfig_Call) RunAndReturn(run func
|
||||||
func (_m *AlertmanagerMock) SilenceState(_a0 context.Context) (notify.SilenceState, error) {
|
func (_m *AlertmanagerMock) SilenceState(_a0 context.Context) (notify.SilenceState, error) {
|
||||||
ret := _m.Called(_a0)
|
ret := _m.Called(_a0)
|
||||||
|
|
||||||
|
if len(ret) == 0 {
|
||||||
|
panic("no return value specified for SilenceState")
|
||||||
|
}
|
||||||
|
|
||||||
var r0 notify.SilenceState
|
var r0 notify.SilenceState
|
||||||
var r1 error
|
var r1 error
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) (notify.SilenceState, error)); ok {
|
if rf, ok := ret.Get(0).(func(context.Context) (notify.SilenceState, error)); ok {
|
||||||
|
|
|
@ -7,8 +7,6 @@ import (
|
||||||
|
|
||||||
alertingNotify "github.com/grafana/alerting/notify"
|
alertingNotify "github.com/grafana/alerting/notify"
|
||||||
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
"github.com/prometheus/alertmanager/api/v2/models"
|
|
||||||
"github.com/prometheus/alertmanager/types"
|
"github.com/prometheus/alertmanager/types"
|
||||||
|
|
||||||
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||||
|
@ -92,36 +90,5 @@ func (am *alertmanager) TestReceivers(ctx context.Context, c apimodels.TestRecei
|
||||||
}
|
}
|
||||||
|
|
||||||
func (am *alertmanager) GetReceivers(_ context.Context) ([]apimodels.Receiver, error) {
|
func (am *alertmanager) GetReceivers(_ context.Context) ([]apimodels.Receiver, error) {
|
||||||
apiReceivers := make([]apimodels.Receiver, 0, len(am.Base.GetReceivers()))
|
return am.Base.GetReceivers(), nil
|
||||||
for _, rcv := range am.Base.GetReceivers() {
|
|
||||||
// Build integrations slice for each receiver.
|
|
||||||
integrations := make([]*models.Integration, 0, len(rcv.Integrations()))
|
|
||||||
for _, integration := range rcv.Integrations() {
|
|
||||||
name := integration.Name()
|
|
||||||
sendResolved := integration.SendResolved()
|
|
||||||
ts, d, err := integration.GetReport()
|
|
||||||
integrations = append(integrations, &apimodels.Integration{
|
|
||||||
Name: &name,
|
|
||||||
SendResolved: &sendResolved,
|
|
||||||
LastNotifyAttempt: strfmt.DateTime(ts),
|
|
||||||
LastNotifyAttemptDuration: d.String(),
|
|
||||||
LastNotifyAttemptError: func() string {
|
|
||||||
if err != nil {
|
|
||||||
return err.Error()
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
active := rcv.Active()
|
|
||||||
name := rcv.Name()
|
|
||||||
apiReceivers = append(apiReceivers, apimodels.Receiver{
|
|
||||||
Active: &active,
|
|
||||||
Integrations: integrations,
|
|
||||||
Name: &name,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return apiReceivers, nil
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -494,10 +494,10 @@ func (am *Alertmanager) GetReceivers(ctx context.Context) ([]apimodels.Receiver,
|
||||||
|
|
||||||
var rcvs []apimodels.Receiver
|
var rcvs []apimodels.Receiver
|
||||||
for _, rcv := range res.Payload {
|
for _, rcv := range res.Payload {
|
||||||
if rcv.Integrations == nil {
|
rcvs = append(rcvs, apimodels.Receiver{
|
||||||
rcv.Integrations = []*apimodels.Integration{}
|
Name: *rcv.Name,
|
||||||
}
|
Integrations: []apimodels.Integration{},
|
||||||
rcvs = append(rcvs, *rcv)
|
})
|
||||||
}
|
}
|
||||||
return rcvs, nil
|
return rcvs, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -715,7 +715,7 @@ func TestIntegrationRemoteAlertmanagerReceivers(t *testing.T) {
|
||||||
// We should start with the default config.
|
// We should start with the default config.
|
||||||
rcvs, err := am.GetReceivers(context.Background())
|
rcvs, err := am.GetReceivers(context.Background())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, "empty-receiver", *rcvs[0].Name)
|
require.Equal(t, "empty-receiver", rcvs[0].Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func genAlert(active bool, labels map[string]string) amv2.PostableAlert {
|
func genAlert(active bool, labels map[string]string) amv2.PostableAlert {
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
// Code generated by mockery v2.42.1. DO NOT EDIT.
|
// Code generated by mockery v2.43.2. DO NOT EDIT.
|
||||||
|
|
||||||
package alertmanager_mock
|
package alertmanager_mock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
|
||||||
|
alertingmodels "github.com/grafana/alerting/models"
|
||||||
|
|
||||||
definitions "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
definitions "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||||
|
|
||||||
mock "github.com/stretchr/testify/mock"
|
mock "github.com/stretchr/testify/mock"
|
||||||
|
|
||||||
models "github.com/grafana/grafana/pkg/services/ngalert/models"
|
models "github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||||
|
@ -401,23 +404,23 @@ func (_c *RemoteAlertmanagerMock_GetAlerts_Call) RunAndReturn(run func(context.C
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetReceivers provides a mock function with given fields: ctx
|
// GetReceivers provides a mock function with given fields: ctx
|
||||||
func (_m *RemoteAlertmanagerMock) GetReceivers(ctx context.Context) ([]v2models.Receiver, error) {
|
func (_m *RemoteAlertmanagerMock) GetReceivers(ctx context.Context) ([]alertingmodels.Receiver, error) {
|
||||||
ret := _m.Called(ctx)
|
ret := _m.Called(ctx)
|
||||||
|
|
||||||
if len(ret) == 0 {
|
if len(ret) == 0 {
|
||||||
panic("no return value specified for GetReceivers")
|
panic("no return value specified for GetReceivers")
|
||||||
}
|
}
|
||||||
|
|
||||||
var r0 []v2models.Receiver
|
var r0 []alertingmodels.Receiver
|
||||||
var r1 error
|
var r1 error
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) ([]v2models.Receiver, error)); ok {
|
if rf, ok := ret.Get(0).(func(context.Context) ([]alertingmodels.Receiver, error)); ok {
|
||||||
return rf(ctx)
|
return rf(ctx)
|
||||||
}
|
}
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) []v2models.Receiver); ok {
|
if rf, ok := ret.Get(0).(func(context.Context) []alertingmodels.Receiver); ok {
|
||||||
r0 = rf(ctx)
|
r0 = rf(ctx)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
if ret.Get(0) != nil {
|
||||||
r0 = ret.Get(0).([]v2models.Receiver)
|
r0 = ret.Get(0).([]alertingmodels.Receiver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,12 +451,12 @@ func (_c *RemoteAlertmanagerMock_GetReceivers_Call) Run(run func(ctx context.Con
|
||||||
return _c
|
return _c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_c *RemoteAlertmanagerMock_GetReceivers_Call) Return(_a0 []v2models.Receiver, _a1 error) *RemoteAlertmanagerMock_GetReceivers_Call {
|
func (_c *RemoteAlertmanagerMock_GetReceivers_Call) Return(_a0 []alertingmodels.Receiver, _a1 error) *RemoteAlertmanagerMock_GetReceivers_Call {
|
||||||
_c.Call.Return(_a0, _a1)
|
_c.Call.Return(_a0, _a1)
|
||||||
return _c
|
return _c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_c *RemoteAlertmanagerMock_GetReceivers_Call) RunAndReturn(run func(context.Context) ([]v2models.Receiver, error)) *RemoteAlertmanagerMock_GetReceivers_Call {
|
func (_c *RemoteAlertmanagerMock_GetReceivers_Call) RunAndReturn(run func(context.Context) ([]alertingmodels.Receiver, error)) *RemoteAlertmanagerMock_GetReceivers_Call {
|
||||||
_c.Call.Return(run)
|
_c.Call.Return(run)
|
||||||
return _c
|
return _c
|
||||||
}
|
}
|
||||||
|
@ -819,6 +822,10 @@ func (_c *RemoteAlertmanagerMock_SaveAndApplyDefaultConfig_Call) RunAndReturn(ru
|
||||||
func (_m *RemoteAlertmanagerMock) SilenceState(_a0 context.Context) (notify.SilenceState, error) {
|
func (_m *RemoteAlertmanagerMock) SilenceState(_a0 context.Context) (notify.SilenceState, error) {
|
||||||
ret := _m.Called(_a0)
|
ret := _m.Called(_a0)
|
||||||
|
|
||||||
|
if len(ret) == 0 {
|
||||||
|
panic("no return value specified for SilenceState")
|
||||||
|
}
|
||||||
|
|
||||||
var r0 notify.SilenceState
|
var r0 notify.SilenceState
|
||||||
var r1 error
|
var r1 error
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) (notify.SilenceState, error)); ok {
|
if rf, ok := ret.Get(0).(func(context.Context) (notify.SilenceState, error)); ok {
|
||||||
|
|
|
@ -1031,33 +1031,29 @@ func TestIntegrationNotificationChannels(t *testing.T) {
|
||||||
err := json.Unmarshal([]byte(b), &receivers)
|
err := json.Unmarshal([]byte(b), &receivers)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
for _, rcv := range receivers {
|
for _, rcv := range receivers {
|
||||||
t.Run("Receiver "+*rcv.Name, func(t *testing.T) {
|
t.Run("Receiver "+rcv.Name, func(t *testing.T) {
|
||||||
var expActive bool
|
var expActive bool
|
||||||
if _, ok := expInactiveReceivers[*rcv.Name]; !ok {
|
if _, ok := expInactiveReceivers[rcv.Name]; !ok {
|
||||||
expActive = true
|
expActive = true
|
||||||
}
|
}
|
||||||
var expErr bool
|
var expErr bool
|
||||||
if _, ok := expNotificationErrors[*rcv.Name]; ok {
|
if _, ok := expNotificationErrors[rcv.Name]; ok {
|
||||||
expErr = true
|
expErr = true
|
||||||
}
|
}
|
||||||
|
|
||||||
require.NotNil(t, rcv.Name)
|
|
||||||
require.NotNil(t, rcv.Active)
|
|
||||||
require.NotEmpty(t, rcv.Integrations)
|
require.NotEmpty(t, rcv.Integrations)
|
||||||
if expActive {
|
if expActive {
|
||||||
require.True(t, *rcv.Active)
|
require.True(t, rcv.Active)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't have test alerts for the default notifier, continue iterating.
|
// We don't have test alerts for the default notifier, continue iterating.
|
||||||
if *rcv.Name == "grafana-default-email" {
|
if rcv.Name == "grafana-default-email" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, integration := range rcv.Integrations {
|
for _, integration := range rcv.Integrations {
|
||||||
require.NotNil(t, integration.Name)
|
require.NotNil(t, integration.Name)
|
||||||
t.Run("Integration "+*integration.Name, func(t *testing.T) {
|
t.Run("Integration "+integration.Name, func(t *testing.T) {
|
||||||
require.NotNil(t, integration.SendResolved)
|
|
||||||
|
|
||||||
// If the receiver is not active, no attempts to send notifications should be registered.
|
// If the receiver is not active, no attempts to send notifications should be registered.
|
||||||
if expActive {
|
if expActive {
|
||||||
// Prometheus' durations get rounded down, so we might end up with "0s" if we have values smaller than 1ms.
|
// Prometheus' durations get rounded down, so we might end up with "0s" if we have values smaller than 1ms.
|
||||||
|
@ -1070,7 +1066,7 @@ func TestIntegrationNotificationChannels(t *testing.T) {
|
||||||
// Check whether we're expecting an error on this integration.
|
// Check whether we're expecting an error on this integration.
|
||||||
if expErr {
|
if expErr {
|
||||||
for _, integration := range rcv.Integrations {
|
for _, integration := range rcv.Integrations {
|
||||||
require.Equal(t, expNotificationErrors[*rcv.Name], integration.LastNotifyAttemptError)
|
require.Equal(t, expNotificationErrors[rcv.Name], integration.LastNotifyAttemptError)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
require.Equal(t, "", integration.LastNotifyAttemptError)
|
require.Equal(t, "", integration.LastNotifyAttemptError)
|
||||||
|
|
Loading…
Reference in New Issue