consul/.changelog
Dhia Ayachi 16b19dd82d
auto-reload configuration when config files change (#12329)
* add config watcher to the config package

* add logging to watcher

* add test and refactor to add WatcherEvent.

* add all API calls and fix a bug with recreated files

* add tests for watcher

* remove the unnecessary use of context

* Add debug log and a test for file rename

* use inode to detect if the file is recreated/replaced and only listen to create events.

* tidy ups (#1535)

* tidy ups

* Add tests for inode reconcile

* fix linux vs windows syscall

* fix linux vs windows syscall

* fix windows compile error

* increase timeout

* use ctime ID

* remove remove/creation test as it's a use case that fail in linux

* fix linux/windows to use Ino/CreationTime

* fix the watcher to only overwrite current file id

* fix linter error

* fix remove/create test

* set reconcile loop to 200 Milliseconds

* fix watcher to not trigger event on remove, add more tests

* on a remove event try to add the file back to the watcher and trigger the handler if success

* fix race condition

* fix flaky test

* fix race conditions

* set level to info

* fix when file is removed and get an event for it after

* fix to trigger handler when we get a remove but re-add fail

* fix error message

* add tests for directory watch and fixes

* detect if a file is a symlink and return an error on Add

* rename Watcher to FileWatcher and remove symlink deref

* add fsnotify@v1.5.1

* fix go mod

* do not reset timer on errors, rename OS specific files

* rename New func

* events trigger on write and rename

* add missing test

* fix flaking tests

* fix flaky test

* check reconcile when removed

* delete invalid file

* fix test to create files with different mod time.

* back date file instead of sleeping

* add watching file in agent command.

* fix watcher call to use new API

* add configuration and stop watcher when server stop

* add certs as watched files

* move FileWatcher to the agent start instead of the command code

* stop watcher before replacing it

* save watched files in agent

* add add and remove interfaces to the file watcher

* fix remove to not return an error

* use `Add` and `Remove` to update certs files

* fix tests

* close events channel on the file watcher even when the context is done

* extract `NotAutoReloadableRuntimeConfig` is a separate struct

* fix linter errors

* add Ca configs and outgoing verify to the not auto reloadable config

* add some logs and fix to use background context

* add tests to auto-config reload

* remove stale test

* add tests to changes to config files

* add check to see if old cert files still trigger updates

* rename `NotAutoReloadableRuntimeConfig` to `StaticRuntimeConfig`

* fix to re add both key and cert file. Add test to cover this case.

* review suggestion

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* add check to static runtime config changes

* fix test

* add changelog file

* fix review comments

* Apply suggestions from code review

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* update flag description

Co-authored-by: FFMMM <FFMMM@users.noreply.github.com>

* fix compilation error

* add static runtime config support

* fix test

* fix review comments

* fix log test

* Update .changelog/12329.txt

Co-authored-by: Dan Upton <daniel@floppy.co>

* transfer tests to runtime_test.go

* fix filewatcher Replace to not deadlock.

* avoid having lingering locks

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* split ReloadConfig func

* fix warning message

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* convert `FileWatcher` into an interface

* fix compilation errors

* fix tests

* extract func for adding and removing files

Co-authored-by: Ashwin Venkatesh <ashwin@hashicorp.com>
Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
Co-authored-by: FFMMM <FFMMM@users.noreply.github.com>
Co-authored-by: Daniel Upton <daniel@floppy.co>
2022-03-31 15:11:49 -04:00
..
2020-10-09 10:51:37 -04:00
2021-04-14 19:41:04 -04:00
2021-04-14 11:50:15 -04:00
2021-05-20 12:57:15 -04:00
2021-08-25 19:46:21 -06:00
2021-08-25 19:46:21 -06:00
2021-11-11 16:09:00 -05:00
2021-11-04 16:52:54 -05:00
2021-11-12 16:10:36 -06:00
2021-12-02 11:41:08 -05:00
2022-01-19 17:28:53 -06:00
2022-03-02 16:44:13 -06:00
2020-10-13 18:16:33 -04:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-06 23:15:29 +02:00
2020-08-12 11:21:54 -05:00
2020-08-28 23:01:04 +02:00
2020-09-15 13:33:55 -07:00
2020-09-14 14:16:47 -06:00
2020-09-10 18:53:36 +02:00
2020-09-02 10:48:11 -05:00
2020-09-15 10:05:23 -07:00
2020-09-25 12:03:49 -04:00
2020-10-20 16:42:06 -04:00
2020-10-09 08:01:55 -07:00
2021-05-18 15:04:12 -04:00
2020-10-07 10:22:40 -05:00
2021-04-06 17:12:10 +08:00
2020-12-30 14:09:50 -06:00
2020-11-11 11:33:38 -06:00
2020-11-09 17:29:06 -05:00
2020-11-17 10:35:56 -05:00
2020-11-13 14:31:14 -08:00
2020-11-20 18:23:01 +01:00
2020-11-30 17:27:39 +00:00
2021-03-16 18:22:25 -04:00
2021-01-05 13:05:42 -05:00
2021-01-20 18:18:46 +00:00
2021-02-26 17:08:33 -06:00
2021-01-29 16:08:39 +00:00
2021-03-11 11:47:35 -08:00
2021-02-08 09:45:58 -07:00
2021-02-08 18:16:07 +01:00
2021-02-16 12:52:23 -05:00
2021-03-11 09:46:53 -08:00
2021-03-09 09:30:01 +00:00
2021-03-17 10:46:21 +00:00
2021-04-29 13:54:05 -05:00
2021-03-17 22:09:02 -06:00
2021-06-14 17:01:16 -04:00
2021-05-04 12:41:43 -07:00
2021-04-27 14:29:48 -04:00
2021-07-14 17:50:00 -04:00
2021-04-15 13:58:28 -06:00
2021-04-14 16:51:21 -04:00
2021-05-03 16:19:09 +01:00
2021-04-27 19:03:17 -04:00
2021-04-29 12:08:03 -04:00
2021-05-04 14:09:14 -04:00
2021-05-06 18:35:52 -04:00
2021-05-21 11:08:50 -04:00
2021-06-02 17:39:30 -04:00
2021-06-15 12:05:52 -04:00
2021-07-26 17:53:32 -04:00
2021-06-15 14:15:30 -06:00
2021-06-17 12:06:26 -07:00
2021-07-07 09:41:01 -04:00
2021-07-06 17:57:36 -04:00
2021-07-06 18:39:40 -04:00
2021-07-15 09:27:46 -06:00
2021-07-28 17:50:01 -04:00
2021-07-30 09:58:11 -07:00
2021-08-18 12:54:11 -04:00
2021-08-20 17:40:33 -06:00
2021-09-20 12:52:19 -05:00
2021-09-22 10:57:36 -07:00
2021-09-29 12:45:42 -04:00
2021-10-19 20:58:28 +01:00
2021-10-20 16:02:14 +05:30
2021-10-27 02:33:36 +03:00
2021-10-21 16:18:32 -04:00
2021-10-21 13:21:22 -04:00
2021-11-10 14:53:52 -05:00
2021-11-01 22:47:20 +00:00
2021-11-09 09:32:27 -08:00
2021-11-08 17:14:27 -07:00
2021-12-02 15:54:40 -08:00
2021-12-21 16:45:45 -05:00
2021-12-13 19:03:12 -07:00
2022-01-05 17:51:03 -05:00
2022-01-04 16:08:06 +00:00
2022-02-02 17:31:08 -08:00
2022-01-06 14:09:13 -05:00
2022-01-12 12:00:18 -05:00
2022-01-12 12:31:28 -08:00
2022-01-18 13:03:22 -05:00
2022-01-24 12:32:22 -08:00
2022-02-10 17:21:34 -07:00
2022-02-03 17:39:36 -05:00
2022-03-01 09:25:52 +01:00
2022-02-14 13:48:52 -06:00
2022-02-15 14:15:34 -05:00
2022-02-17 12:17:12 -08:00
2022-02-25 19:29:00 +05:30
2022-02-25 15:43:06 +00:00
2022-02-24 17:05:55 -08:00
2022-03-10 18:48:27 -08:00
2022-03-02 17:00:02 -06:00
2022-03-07 14:39:33 -05:00
2022-03-31 10:18:48 -05:00
2020-10-09 22:44:51 -04:00