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

This commit is contained in:
Jack Westbrook 2021-04-14 09:38:53 +02:00 committed by GitHub
parent f97c056965
commit b0470c84a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,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);
}