rill icon indicating copy to clipboard operation
rill copied to clipboard

Runtime: Fix multiple controller restart due to duplicate watcher events for rill.yaml and .env

Open k-anshul opened this issue 1 year ago • 1 comments

The watcher sends multiple events for a single edit in a file. This leads to multiple restarts of the controller due to edit in rill.yaml or .env file. We now take a diff of the latest file with the one present in parser state and only trigger restart if the contents are actually changed.

k-anshul avatar May 03 '24 05:05 k-anshul

One other comment: I noticed when reading this that in runtime/reconcilers/project_parser.go on line 295, if diff == nil, then it doesn't update the project config at all. I guess it should still update the project config, but without triggering a restart and returning?

Yes it was a miss. Didn't see any issues in testing because ProjectVariables are already updated in registry.go before starting controller but will be an issue for other configs like FeatureFlags. Fixed it.

k-anshul avatar May 03 '24 10:05 k-anshul