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
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
}