Alerting: recognize Cortex datasources correctly in the frontend (#44316)

* Alerting: always use msg field for user facing errors

* fix: revert front-end Cortex detection

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
This commit is contained in:
Jean-Philippe Quéméner
2022-01-21 15:44:11 +01:00
committed by GitHub
parent e1af78954f
commit 8ee3f59cd4
7 changed files with 38 additions and 34 deletions
@@ -67,7 +67,7 @@ func TestAdminConfiguration_SendingToExternalAlertmanagers(t *testing.T) {
resp := getRequest(t, alertsURL, http.StatusNotFound) // nolint
b, err := ioutil.ReadAll(resp.Body)
require.NoError(t, err)
require.JSONEq(t, string(b), "{\"message\": \"API error\",\"error\": \"no admin configuration available\"}")
require.JSONEq(t, string(b), "{\"message\": \"no admin configuration available\",\"error\": \"no admin configuration available\"}")
}
// Now, lets re-set external Alertmanagers for main organisation.