AzureMonitor: Make ResourceNames() case insensitive (#40690)

This commit is contained in:
Andres Martinez Gotor 2021-10-20 16:35:35 +02:00 committed by GitHub
parent 302fef394a
commit ed68056b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -573,6 +573,16 @@ describe('AzureMonitorDatasource', () => {
expect(results[0].value).toEqual('nodeapp');
});
});
it('should return ignore letter case', () => {
return ctx.ds
.getResourceNames('9935389e-9122-4ef9-95f9-1513dd24753f', 'nodeapp', 'microsoft.insights/Components')
.then((results: Array<{ text: string; value: string }>) => {
expect(results.length).toEqual(1);
expect(results[0].text).toEqual('nodeapp');
expect(results[0].value).toEqual('nodeapp');
});
});
});
describe('and the metric definition is blobServices', () => {

View File

@ -40,7 +40,10 @@ export default class ResponseParser {
}
for (let i = 0; i < result.value.length; i++) {
if (result.value[i].type === metricDefinition) {
if (
typeof result.value[i].type === 'string' &&
result.value[i].type.toLocaleLowerCase() === metricDefinition.toLocaleLowerCase()
) {
list.push({
text: result.value[i].name,
value: result.value[i].name,