mediamtx/internal/confwatcher
Florian Vallée f5dc53e0f2 improve config file watcher to support k8s configmap reloads
The config file watcher assumed a simple configuration where the
existing configuration file is overwritten by a text editor.

In practice this does not detect some more complex configuration change
scenarios such as :
* The configuration file is behind a symlink and the symlink is updated
* The configuration file is behind a double symlink (k8s configmap
  update)
* The configuration file is not updated but removed the re-created

In order to fix these cases :
* Watch the configuration file parent directory instead of the file
itself, this lets us grab events event if the file was removed and a new
file is used.
* In addition to read/write event matching, watch for any change in
the configuration file path. This handles the symlink case where the
file itself hasn't changed but its location did

v2:
- apply gofmt
2021-01-13 21:57:09 +01:00
..
confwatcher.go improve config file watcher to support k8s configmap reloads 2021-01-13 21:57:09 +01:00
confwatcher_test.go confwatcher: add tests 2021-01-13 20:48:57 +01:00