Skip to content

Commit

Permalink
Alerting: Return empty list on export if no rules exist (grafana#69023)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyQQQQ authored May 25, 2023
1 parent 74fd874 commit 5717d89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/services/ngalert/provisioning/alert_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 5717d89

Please sign in to comment.