fix empty rules in rulegroup of prometheusrules (#5298)
Signed-off-by: junot <junotxiang@kubesphere.io> Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
@@ -196,6 +196,9 @@ func makePrometheusRuleGroups(log logr.Logger, groupList client.ObjectList,
|
||||
prules = append(prules, *prule)
|
||||
}
|
||||
}
|
||||
if len(prules) == 0 {
|
||||
continue
|
||||
}
|
||||
rulegroups = append(rulegroups, &promresourcesv1.RuleGroup{
|
||||
Name: group.Name,
|
||||
Interval: group.Spec.Interval,
|
||||
@@ -216,6 +219,9 @@ func makePrometheusRuleGroups(log logr.Logger, groupList client.ObjectList,
|
||||
prules = append(prules, *prule)
|
||||
}
|
||||
}
|
||||
if len(prules) == 0 {
|
||||
continue
|
||||
}
|
||||
rulegroups = append(rulegroups, &promresourcesv1.RuleGroup{
|
||||
Name: group.Name,
|
||||
Interval: group.Spec.Interval,
|
||||
@@ -238,6 +244,9 @@ func makePrometheusRuleGroups(log logr.Logger, groupList client.ObjectList,
|
||||
prules = append(prules, *prule)
|
||||
}
|
||||
}
|
||||
if len(prules) == 0 {
|
||||
continue
|
||||
}
|
||||
rulegroups = append(rulegroups, &promresourcesv1.RuleGroup{
|
||||
Name: group.Name,
|
||||
Interval: group.Spec.Interval,
|
||||
|
||||
Reference in New Issue
Block a user