From e5d2e1b2680ee4c4a3094bafafae4f1b3eb13d99 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 2 Mar 2021 22:56:06 +0100 Subject: [PATCH] Call SetDirectory for HTTP clients fix #2500 Signed-off-by: Julien Pivotto --- config/config.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/config/config.go b/config/config.go index 3af55ca8..12bfa819 100644 --- a/config/config.go +++ b/config/config.go @@ -218,6 +218,31 @@ func resolveFilepaths(baseDir string, cfg *Config) { for i, tf := range cfg.Templates { cfg.Templates[i] = join(tf) } + + cfg.Global.HTTPConfig.SetDirectory(baseDir) + for _, receiver := range cfg.Receivers { + for _, cfg := range receiver.OpsGenieConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + for _, cfg := range receiver.PagerdutyConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + for _, cfg := range receiver.PushoverConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + for _, cfg := range receiver.SlackConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + for _, cfg := range receiver.VictorOpsConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + for _, cfg := range receiver.WebhookConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + for _, cfg := range receiver.WechatConfigs { + cfg.HTTPConfig.SetDirectory(baseDir) + } + } } // MuteTimeInterval represents a named set of time intervals for which a route should be muted.