From 7e615dcdf00566dae16bf981165c7c4ffabf35d3 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Fri, 3 Jul 2015 14:53:02 +0200 Subject: [PATCH] cmd/promtool: resolve rule files relative to config file --- cmd/promtool/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/promtool/main.go b/cmd/promtool/main.go index b144e6219..791fa069f 100644 --- a/cmd/promtool/main.go +++ b/cmd/promtool/main.go @@ -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