From cc1d9c767f8b6e8a860f3d6500e01786b5fca0d5 Mon Sep 17 00:00:00 2001 From: Aiwantaozi Date: Fri, 19 Jul 2019 11:40:58 +0800 Subject: [PATCH] Add exist condition for expression alert Problem: current we require the user to input a threshold number, could not support the scenario any matched condition event happens Solution: add exist condition and remove the required in thresdhold Issue: https://github.com/rancher/rancher/issues/21302 --- apis/management.cattle.io/v3/alerting_types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/management.cattle.io/v3/alerting_types.go b/apis/management.cattle.io/v3/alerting_types.go index 8f75c7bf..783d794c 100644 --- a/apis/management.cattle.io/v3/alerting_types.go +++ b/apis/management.cattle.io/v3/alerting_types.go @@ -203,8 +203,8 @@ type MetricRule struct { Expression string `json:"expression,omitempty" norman:"required"` Description string `json:"description,omitempty"` Duration string `json:"duration,omitempty" norman:"required"` - Comparison string `json:"comparison,omitempty" norman:"type=enum,options=equal|not-equal|greater-than|less-than|greater-or-equal|less-or-equal,default=equal"` - ThresholdValue float64 `json:"thresholdValue,omitempty" norman:"required,type=float"` + Comparison string `json:"comparison,omitempty" norman:"type=enum,options=equal|not-equal|greater-than|less-than|greater-or-equal|less-or-equal|has-value,default=equal"` + ThresholdValue float64 `json:"thresholdValue,omitempty" norman:"type=float"` } type TimingField struct {