Alerting: do not check for folder in file provisioning (#84822)

provide nil folder service in file provisioning
This commit is contained in:
Yuri Tseretyan 2024-03-20 10:39:03 -04:00 committed by GitHub
parent 18eac9df9e
commit 04c9f459ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -663,8 +663,8 @@ func (service *AlertRuleService) ensureRuleNamespace(ctx context.Context, user i
return fmt.Errorf("%w: folderUID must be set", models.ErrAlertRuleFailedValidation)
}
if user == nil {
// user is nil when this is called during file provisioning,
if service.folderService == nil {
// folder service is nil when this is called during file provisioning,
// which already creates the folder if it does not exist
return nil
}

View File

@ -248,7 +248,7 @@ func (ps *ProvisioningServiceImpl) ProvisionAlerting(ctx context.Context) error
ruleService := provisioning.NewAlertRuleService(
st,
st,
ps.folderService,
nil,
ps.dashboardService,
ps.quotaService,
ps.SQLStore,