Revert "Allow fsnotify to reload config files on k8s (or symlinks)"

This commit is contained in:
Julien Salleyron 2020-03-03 18:44:04 +01:00 committed by GitHub
parent e9d0a16a3b
commit 67e17def56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,19 +110,6 @@ func (p *Provider) addWatcher(pool *safe.Pool, directory string, configurationCh
case <-ctx.Done(): case <-ctx.Done():
return return
case evt := <-watcher.Events: case evt := <-watcher.Events:
if evt.Op == fsnotify.Remove {
err = watcher.Remove(evt.Name)
if err != nil {
log.WithoutContext().WithField(log.ProviderName, providerName).
Errorf("Could not remove watcher for %s: %s", directory, err)
}
err = watcher.Add(directory)
if err != nil {
log.WithoutContext().WithField(log.ProviderName, providerName).
Errorf("Could not re-add watcher for %s: %s", directory, err)
}
}
if p.Directory == "" { if p.Directory == "" {
_, evtFileName := filepath.Split(evt.Name) _, evtFileName := filepath.Split(evt.Name)
_, confFileName := filepath.Split(p.Filename) _, confFileName := filepath.Split(p.Filename)