Merge pull request #6147 from rainzm/fix/scaling_notification

fix/monitor: AutoScalingNotifier.ShouldNotify should call NotifierBase.ShouldNotify
This commit is contained in:
Zexi Li
2020-04-30 14:41:27 +08:00
committed by GitHub
@@ -63,9 +63,10 @@ func (as *AutoScalingNotifier) Notify(ctx *alerting.EvalContext, data jsonutils.
return nil
}
func (as *AutoScalingNotifier) ShouldNotify(ctx context.Context, evalContext *alerting.EvalContext, notificationState *models.SAlertnotification) bool {
if evalContext.Rule.State == monitor.AlertStateOK || evalContext.NoDataFound {
func (as *AutoScalingNotifier) ShouldNotify(ctx context.Context, evalContext *alerting.EvalContext,
notificationState *models.SAlertnotification) bool {
if evalContext.NoDataFound {
return false
}
return true
return as.NotifierBase.ShouldNotify(ctx, evalContext, notificationState)
}