cmd/promtool: resolve rule files relative to config file

This commit is contained in:
Fabian Reinartz 2015-07-03 14:53:02 +02:00
parent feb8a03503
commit 7e615dcdf0
1 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,10 @@ func checkConfig(t cli.Term, filename string) ([]string, error) {
}
var ruleFiles []string
for _, rf := range cfg.RuleFiles {
if !filepath.IsAbs(rf) {
rf = filepath.Join(filepath.Dir(filename), rf)
}
rfs, err := filepath.Glob(rf)
if err != nil {
return nil, err