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")
|
||||
}
|
||||
for _, p := range d.paths {
|
||||
if idx := strings.LastIndex(p, "/"); idx > -1 {
|
||||
p = p[:idx]
|
||||
if dir, _ := filepath.Split(p); dir != "" {
|
||||
p = dir
|
||||
} else {
|
||||
p = "./"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue