ds-querier: return QDR instead of k8s error (#95184)

* ds-querier: return QDR instead of k8s error

After parseQuery we know the request is a valid k8s request but we don't
know if the query is valid, therefore this change returns a QDR that
other systems, e.g. alerting ruler, can de-serialize properly.

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

* ds-querier: fix tests

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* tweak status

* refactor refID to empty

---------

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
This commit is contained in:
Adam Simpson
2024-10-23 09:58:22 -04:00
committed by GitHub
parent 008c51b5b1
commit 61b9ffd324
4 changed files with 48 additions and 23 deletions
+8 -8
View File
@@ -139,14 +139,14 @@ func TestIntegrationSimpleQuery(t *testing.T) {
require.Error(t, err, "expecting a 400")
require.JSONEq(t, `{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "[sse.dependencyError] did not execute expression [Y] due to a failure to of the dependent expression or query [X]",
"reason": "Invalid",
"code": 400
}`, string(body))
"results": {
"": {
"error": "[sse.dependencyError] did not execute expression [Y] due to a failure to of the dependent expression or query [X]",
"status": 400,
"errorSource": ""
}
}
}`, string(body))
// require.JSONEq(t, `{
// "status": "Failure",
// "metadata": {},