mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
AzureMonitor: Fix query variable migration (#63991)
* AzureMonitor: Fix query variable migration Somehow the query object becomes "unwriteable" post 9.4. To workaround this I clone the query object before doing any migrations which removes the immutability and allows the migrations to function as they did. Fixes #63943 * refactor deepClone out to keep object the same
This commit is contained in:
parent
0b2dfaa710
commit
3498785184
@ -33,7 +33,15 @@ export default function migrateQuery(query: AzureMonitorQuery): AzureMonitorQuer
|
||||
}
|
||||
|
||||
if (workingQuery.azureLogAnalytics?.resource) {
|
||||
workingQuery = migrateLogsResource(workingQuery);
|
||||
workingQuery = {
|
||||
...workingQuery,
|
||||
azureLogAnalytics: {
|
||||
...workingQuery.azureLogAnalytics,
|
||||
resources: [workingQuery.azureLogAnalytics.resource],
|
||||
},
|
||||
};
|
||||
|
||||
delete workingQuery.azureLogAnalytics?.resource;
|
||||
}
|
||||
|
||||
return workingQuery;
|
||||
@ -179,15 +187,3 @@ function migrateResourceGroupAndName(query: AzureMonitorQuery): AzureMonitorQuer
|
||||
|
||||
return workingQuery;
|
||||
}
|
||||
|
||||
function migrateLogsResource(query: AzureMonitorQuery): AzureMonitorQuery {
|
||||
let workingQuery = query;
|
||||
|
||||
if (workingQuery.azureLogAnalytics && workingQuery.azureLogAnalytics.resource) {
|
||||
workingQuery.azureLogAnalytics.resources = [workingQuery.azureLogAnalytics.resource];
|
||||
|
||||
delete workingQuery.azureLogAnalytics.resource;
|
||||
}
|
||||
|
||||
return workingQuery;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user