Alerting: Remove grafanaManagedRecordingRules feature flag (#105569)
This commit is contained in:
@@ -344,14 +344,6 @@ func (srv *ProvisioningSrv) RoutePostAlertRule(c *contextmodel.ReqContext, ar de
|
||||
return ErrResp(http.StatusBadRequest, err, "")
|
||||
}
|
||||
|
||||
if upstreamModel.Type() == alerting_models.RuleTypeRecording && !srv.featureManager.IsEnabledGlobally(featuremgmt.FlagGrafanaManagedRecordingRules) {
|
||||
return ErrResp(
|
||||
http.StatusBadRequest,
|
||||
fmt.Errorf("%w: recording rules cannot be created on this instance", alerting_models.ErrAlertRuleFailedValidation),
|
||||
"",
|
||||
)
|
||||
}
|
||||
|
||||
provenance := determineProvenance(c)
|
||||
createdAlertRule, err := srv.alertRules.CreateAlertRule(c.Req.Context(), c.SignedInUser, upstreamModel, alerting_models.Provenance(provenance))
|
||||
if errors.Is(err, alerting_models.ErrAlertRuleFailedValidation) {
|
||||
@@ -377,14 +369,6 @@ func (srv *ProvisioningSrv) RoutePutAlertRule(c *contextmodel.ReqContext, ar def
|
||||
ErrResp(http.StatusBadRequest, err, "")
|
||||
}
|
||||
|
||||
if updated.Type() == alerting_models.RuleTypeRecording && !srv.featureManager.IsEnabledGlobally(featuremgmt.FlagGrafanaManagedRecordingRules) {
|
||||
return ErrResp(
|
||||
http.StatusBadRequest,
|
||||
fmt.Errorf("%w: recording rules cannot be created on this instance", alerting_models.ErrAlertRuleFailedValidation),
|
||||
"",
|
||||
)
|
||||
}
|
||||
|
||||
if UID == "" {
|
||||
// If there is no UID, return 404 as the UID is part of the URL.
|
||||
return response.Empty(http.StatusNotFound)
|
||||
|
||||
Reference in New Issue
Block a user