Alerting: use static channel configuration to determinate secure fields (#52527)

* Alerting: use static channel configuration to determinate secure fields

* move to channels package

* introduce channel_config package to fix cyclic import

* add missing changes

* compare type to type
This commit is contained in:
Jean-Philippe Quéméner
2022-07-20 19:58:36 +02:00
committed by GitHub
parent 7d90f2f1a3
commit ba9c18d9c3
4 changed files with 17 additions and 42 deletions
@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/ngalert/notifier"
"github.com/grafana/grafana/pkg/services/ngalert/notifier/channels_config"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/tests/testinfra"
)
@@ -44,7 +44,7 @@ func TestAvailableChannels(t *testing.T) {
require.NoError(t, err)
require.Equal(t, 200, resp.StatusCode)
expNotifiers := notifier.GetAvailableNotifiers()
expNotifiers := channels_config.GetAvailableNotifiers()
expJson, err := json.Marshal(expNotifiers)
require.NoError(t, err)
require.Equal(t, string(expJson), string(b))