Throw error when continue in route root of Alertmanager config
This commit is contained in:
parent
91a2b9d717
commit
dc782f2dd4
|
@ -23,6 +23,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/prometheus/common/model"
|
"github.com/prometheus/common/model"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
@ -51,6 +52,10 @@ func Load(s string) (*Config, error) {
|
||||||
return nil, errors.New("no route provided in config")
|
return nil, errors.New("no route provided in config")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.Route.Continue {
|
||||||
|
return nil, errors.New("cannot have continue in root route")
|
||||||
|
}
|
||||||
|
|
||||||
cfg.original = s
|
cfg.original = s
|
||||||
return cfg, nil
|
return cfg, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue