From 4fec1faea197b0c6e79de27df82f18fbaf025819 Mon Sep 17 00:00:00 2001 From: Aiwantaozi Date: Thu, 14 Feb 2019 11:59:08 +0800 Subject: [PATCH] add option inherit advance from alert group in the alert rule as the default value. Problem: both alert group and alert rule advance option is confused, we need to make then simple Solution: alert rule use alert group level advance option as default but user can edit if they don't have to inherit from group Issue: https://github.com/rancher/rancher/issues/17538 --- apis/management.cattle.io/v3/alerting_types.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apis/management.cattle.io/v3/alerting_types.go b/apis/management.cattle.io/v3/alerting_types.go index 310acdec..2e0c0435 100644 --- a/apis/management.cattle.io/v3/alerting_types.go +++ b/apis/management.cattle.io/v3/alerting_types.go @@ -195,6 +195,7 @@ type CommonGroupField struct { type CommonRuleField struct { DisplayName string `json:"displayName,omitempty"` Severity string `json:"severity,omitempty" norman:"required,options=info|critical|warning,default=critical"` + Inherited *bool `json:"inherited,omitempty" norman:"default=true"` TimingField } @@ -207,9 +208,9 @@ type MetricRule struct { } type TimingField struct { - GroupWaitSeconds int `json:"groupWaitSeconds,omitempty" norman:"required,default=30,min=0"` - GroupIntervalSeconds int `json:"groupIntervalSeconds,omitempty" norman:"required,default=180,min=0"` - RepeatIntervalSeconds int `json:"repeatIntervalSeconds,omitempty" norman:"required,default=3600,min=0"` + GroupWaitSeconds int `json:"groupWaitSeconds,omitempty" norman:"required,default=30,min=1"` + GroupIntervalSeconds int `json:"groupIntervalSeconds,omitempty" norman:"required,default=180,min=1"` + RepeatIntervalSeconds int `json:"repeatIntervalSeconds,omitempty" norman:"required,default=3600,min=1"` } type NodeRule struct {