mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-29 06:30:51 -08:00
Merge pull request #12903 from roidelapluie/fix-pr-7023
rulefmt: remove unreachable code
This commit is contained in:
commit
b6dbfcc15f
|
@ -173,17 +173,11 @@ func (r *RuleNode) Validate() (nodes []WrappedError) {
|
|||
})
|
||||
}
|
||||
if r.Record.Value == "" && r.Alert.Value == "" {
|
||||
if r.Record.Value == "0" {
|
||||
nodes = append(nodes, WrappedError{
|
||||
err: fmt.Errorf("one of 'record' or 'alert' must be set"),
|
||||
node: &r.Alert,
|
||||
})
|
||||
} else {
|
||||
nodes = append(nodes, WrappedError{
|
||||
err: fmt.Errorf("one of 'record' or 'alert' must be set"),
|
||||
node: &r.Record,
|
||||
})
|
||||
}
|
||||
nodes = append(nodes, WrappedError{
|
||||
err: fmt.Errorf("one of 'record' or 'alert' must be set"),
|
||||
node: &r.Record,
|
||||
nodeAlt: &r.Alert,
|
||||
})
|
||||
}
|
||||
|
||||
if r.Expr.Value == "" {
|
||||
|
|
Loading…
Reference in a new issue