Alerting: Export rule validation logic and make it portable (#83555)

* ValidateInterval doesn't need the entire config

* Validation no longer depends on entire folder now that we've dropped foldertitle from api

* Don't depend on entire config struct

* Export validate group
This commit is contained in:
Alexander Weaver
2024-02-28 14:40:13 -06:00
committed by GitHub
parent af528d2f66
commit a862a4264d
5 changed files with 46 additions and 33 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ func (srv RulerSrv) ExportFromPayload(c *contextmodel.ReqContext, ruleGroupConfi
return toNamespaceErrorResponse(err)
}
rulesWithOptionals, err := validateRuleGroup(&ruleGroupConfig, c.SignedInUser.GetOrgID(), namespace, srv.cfg)
rulesWithOptionals, err := ValidateRuleGroup(&ruleGroupConfig, c.SignedInUser.GetOrgID(), namespace.UID, RuleLimitsFromConfig(srv.cfg))
if err != nil {
return ErrResp(http.StatusBadRequest, err, "")
}