mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: replace usage of simplejson to json.RawMessage in NotificationChannelConfig (#60423)
* introduce alias for json.RawMessage with name RawMessage. This is needed to keep raw JSON and implement a marshaler for YAML, which does not seem to be used but there are tests that fail. * replace usage of simplejson with RawMessage in NotificationChannelConfig * remove usage of simplejson in tests * change migration code to convert simplejson to raw message
This commit is contained in:
@@ -470,6 +470,10 @@ func (m *migration) validateAlertmanagerConfig(orgID int64, config *PostableUser
|
||||
secureSettings[k] = d
|
||||
}
|
||||
|
||||
data, err := gr.Settings.MarshalJSON()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var (
|
||||
cfg = &channels.NotificationChannelConfig{
|
||||
UID: gr.UID,
|
||||
@@ -477,10 +481,9 @@ func (m *migration) validateAlertmanagerConfig(orgID int64, config *PostableUser
|
||||
Name: gr.Name,
|
||||
Type: gr.Type,
|
||||
DisableResolveMessage: gr.DisableResolveMessage,
|
||||
Settings: gr.Settings,
|
||||
Settings: data,
|
||||
SecureSettings: secureSettings,
|
||||
}
|
||||
err error
|
||||
)
|
||||
|
||||
// decryptFunc represents the legacy way of decrypting data. Before the migration, we don't need any new way,
|
||||
|
||||
Reference in New Issue
Block a user