Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
POC for #280
I tested the code locally (no automated test yet) and it does work, however the code is a bit strange. The code has almost nothing to do with Kubernetes anymore. The only thing that relates to kubernetes is the way Kubernetes changes data in mounted volumes.
The game.properties file is actually a symbolic link, so you cannot have watch events on this. Every time the files are changed, Kubernetes creates a directory like:
..2021_03_18_17_30_18.531648931
and creates some temp folders and deletes the old ones.These are the events fired every time a change happens in chronological order:
In the code I just listen to the 1 MODIFY event, remove all propertysources and add them all back again after.
Maybe this code should be in a different repo as another bootstrap/client-config/hot-reload file repo. Instead of using Consul, Kubernetes,... you just use files to drive you configuration and have the possibility to change them on the fly.
bootstrap.yaml to make this work
Looking forward to ideas.