Merge pull request #2502 from roidelapluie/set-directory

Call SetDirectory for HTTP clients
This commit is contained in:
Julien Pivotto 2021-03-03 15:29:23 +01:00 committed by GitHub
commit fe39595143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -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.