influxdb: check for invalid program-flow (#37474)

This commit is contained in:
Gábor Farkas
2021-08-10 14:18:29 +02:00
committed by GitHub
parent 707d3536f0
commit 476a227505

View File

@@ -182,10 +182,12 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
return true;
}
/**
* Only applied on flux queries
*/
applyTemplateVariables(query: InfluxQuery, scopedVars: ScopedVars): Record<string, any> {
// this only works in flux-mode, it should not be called in non-flux-mode
if (!this.isFlux) {
throw new Error('applyTemplateVariables called in influxql-mode. this should never happen');
}
return {
...query,
query: this.templateSrv.replace(query.query ?? '', scopedVars), // The raw query text