Google Cloud Monitoring: Fix project variable (#66524)

Google Cloud Monitoring: fix project variable

Also fix typo found while debugging
This commit is contained in:
Adam Simpson 2023-04-14 11:11:25 -04:00 committed by GitHub
parent a6a7cebbe5
commit 02951e8a26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -645,7 +645,7 @@ func (s *Service) getDSInfo(pluginCtx backend.PluginContext) (*datasourceInfo, e
instance, ok := i.(*datasourceInfo)
if !ok {
return nil, fmt.Errorf("failed to cast datsource info")
return nil, fmt.Errorf("failed to cast datasource info")
}
return instance, nil

View File

@ -62,7 +62,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
async componentDidMount() {
await this.props.datasource.ensureGCEDefaultProject();
const projectName = this.props.datasource.getDefaultProject();
const projectName = this.props.query.projectName || this.props.datasource.getDefaultProject();
const projects = (await this.props.datasource.getProjects()) as MetricDescriptor[];
const metricDescriptors = await this.props.datasource.getMetricTypes(
this.props.query.projectName || this.props.datasource.getDefaultProject()