mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Merge pull request #12488 from mharbison72/filesd-windows-watcher
Fix path handling in File-SD watcher to allow directory monitoring on…
This commit is contained in:
commit
446dff01ea
|
@ -226,8 +226,8 @@ func (d *Discovery) watchFiles() {
|
||||||
panic("no watcher configured")
|
panic("no watcher configured")
|
||||||
}
|
}
|
||||||
for _, p := range d.paths {
|
for _, p := range d.paths {
|
||||||
if idx := strings.LastIndex(p, "/"); idx > -1 {
|
if dir, _ := filepath.Split(p); dir != "" {
|
||||||
p = p[:idx]
|
p = dir
|
||||||
} else {
|
} else {
|
||||||
p = "./"
|
p = "./"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue