From 20bdaaf949f5cec8539d2c02ce9a5731f60311e5 Mon Sep 17 00:00:00 2001 From: Martin Chodur Date: Mon, 3 Sep 2018 06:06:01 +0200 Subject: [PATCH] fix amtool: Fixed config path check in amtool (#1538) Signed-off-by: Martin Chodur --- CHANGELOG.md | 1 + cli/config/config.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd26f66..157fa96d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [CHANGE] Revert Alertmanager working directory changes in Docker image back to `/alertmanager` (#1435) * [CHANGE] Remove `api/v1/alerts/groups` GET endpoint (#1508) * [FEATURE] [amtool] Added `config routes` tools for vizualization and testing routes (#1511) +* [BUGFIX] [amtool] Fixed issue with loading path of a default configs (#1529) ## 0.15.2 / 2018-08-14 diff --git a/cli/config/config.go b/cli/config/config.go index 32517f12..15cd5e64 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -34,6 +34,9 @@ type Resolver struct { func NewResolver(files []string, legacyFlags map[string]string) (*Resolver, error) { flags := map[string]string{} for _, f := range files { + if _, err := os.Stat(f); err != nil { + continue + } b, err := ioutil.ReadFile(f) if err != nil { if os.IsNotExist(err) {