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
co-authored by Gábor Farkas Sarah Zinger
parent 008c51b5b1
commit 61b9ffd324
4 changed files with 48 additions and 23 deletions
+17
View File
@@ -77,3 +77,20 @@ func makeCyclicError(refID string) error {
}
return cyclicErr.Build(data)
}
type ErrorWithRefID struct {
err error
refId string
}
func (ewr ErrorWithRefID) Error() string {
return ewr.err.Error()
}
func NewErrorWithRefID(refId string, err error) error {
ewr := ErrorWithRefID{
err: err,
refId: refId,
}
return ewr
}