Alerting: Return empty list on export if no rules exist (#69023)

This commit is contained in:
Jean-Philippe Quéméner 2023-05-25 14:12:18 +02:00 committed by GitHub
parent 74fd874365
commit 5717d8954f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,6 +467,10 @@ func (service *AlertRuleService) GetAlertGroupsWithFolderTitle(ctx context.Conte
namespaces[r.NamespaceUID] = append(namespaces[r.NamespaceUID], &groupKey)
}
if len(namespaces) == 0 {
return []models.AlertRuleGroupWithFolderTitle{}, nil
}
dq := dashboards.GetDashboardsQuery{
DashboardUIDs: nil,
}