mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 13:14:05 -08:00
config: resolve file SD paths relative to config
This commit is contained in:
parent
426125298e
commit
65b087bcc1
|
@ -281,6 +281,11 @@ func resolveFilepaths(baseDir string, cfg *Config) {
|
|||
consulcfg.TLSConfig.CertFile = join(consulcfg.TLSConfig.CertFile)
|
||||
consulcfg.TLSConfig.KeyFile = join(consulcfg.TLSConfig.KeyFile)
|
||||
}
|
||||
for _, filecfg := range cfg.FileSDConfigs {
|
||||
for i, fn := range filecfg.Files {
|
||||
filecfg.Files[i] = join(fn)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, cfg := range cfg.ScrapeConfigs {
|
||||
|
|
|
@ -104,11 +104,11 @@ var expectedConf = &Config{
|
|||
|
||||
FileSDConfigs: []*FileSDConfig{
|
||||
{
|
||||
Files: []string{"foo/*.slow.json", "foo/*.slow.yml", "single/file.yml"},
|
||||
Files: []string{"testdata/foo/*.slow.json", "testdata/foo/*.slow.yml", "testdata/single/file.yml"},
|
||||
RefreshInterval: model.Duration(10 * time.Minute),
|
||||
},
|
||||
{
|
||||
Files: []string{"bar/*.yaml"},
|
||||
Files: []string{"testdata/bar/*.yaml"},
|
||||
RefreshInterval: model.Duration(5 * time.Minute),
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue