fix(datasource_srv): prevent infinite loop where default datasource is named default (#32949) (#32967)

(cherry picked from commit b0470c84a5)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-04-14 10:38:55 +02:00
committed by GitHub
co-authored by Jack Westbrook
parent eebe4a5e6f
commit b6763e0ac2
@@ -97,7 +97,7 @@ export class DatasourceSrv implements DataSourceService {
// Interpolation here is to support template variable in data source selection
nameOrUid = this.templateSrv.replace(nameOrUid, scopedVars, variableInterpolation);
if (nameOrUid === 'default') {
if (nameOrUid === 'default' && this.defaultName !== 'default') {
return this.get(this.defaultName);
}