AssertMaxRulesPerRuleGroup limit has not been reached compared to the current number of rules in a rule group in input and returns an error if so.
(userID string, rules int)
| 1566 | // AssertMaxRulesPerRuleGroup limit has not been reached compared to the current |
| 1567 | // number of rules in a rule group in input and returns an error if so. |
| 1568 | func (r *Ruler) AssertMaxRulesPerRuleGroup(userID string, rules int) error { |
| 1569 | limit := r.limits.RulerMaxRulesPerRuleGroup(userID) |
| 1570 | |
| 1571 | if limit <= 0 { |
| 1572 | return nil |
| 1573 | } |
| 1574 | |
| 1575 | if rules <= limit { |
| 1576 | return nil |
| 1577 | } |
| 1578 | return fmt.Errorf(errMaxRulesPerRuleGroupPerUserLimitExceeded, limit, rules) |
| 1579 | } |
| 1580 | |
| 1581 | func (r *Ruler) DeleteTenantConfiguration(w http.ResponseWriter, req *http.Request) { |
| 1582 | logger := util_log.WithContext(req.Context(), r.logger) |
no test coverage detected