mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-10-11 00:36:38 +00:00
fix: runtime config update ignored by config file
Runtime settings were handed back to pydantic-settings as init settings,
which rank below the config file and the environment. Any key already
present in EOS.config.json or in the environment silently discarded the
update, so a bulk PUT /v1/config returned 200 without applying anything,
while the granular PUT /v1/config/{path} endpoint kept working.
Add a dedicated runtime settings source ranked directly below the command
line arguments and record granular updates there as well, so both
endpoints share one store that survives re-evaluation of the settings
sources. Environment variables keep precedence over the config file for
all keys that were not set at runtime.
Also repairs revert_settings() and update(), which passed their data
through the same init settings.
Closes #1303
This commit is contained in:
@@ -40,10 +40,15 @@ Use endpoint `POST /v1/config/reset` to reset the configuration to the values in
|
||||
|
||||
The configuration sources and their priorities are as follows:
|
||||
|
||||
1. `Settings`: Provided during runtime by the REST interface
|
||||
2. `Environment Variables`: Defined at startup of the REST server and during runtime
|
||||
3. `EOS Configuration File`: Read at startup of the REST server and on request
|
||||
4. `Default Values`
|
||||
1. `Command Line Arguments`: Provided at startup of the REST server
|
||||
2. `Settings`: Provided during runtime by the REST interface
|
||||
3. `Environment Variables`: Defined at startup of the REST server and during runtime
|
||||
4. `EOS Configuration File`: Read at startup of the REST server and on request
|
||||
5. `Default Values`
|
||||
|
||||
Runtime settings are kept until they are reset by `POST /v1/config/reset`. All other sources are
|
||||
re-evaluated on every configuration change, which keeps environment variable changes effective for
|
||||
all configuration keys that were not set during runtime.
|
||||
|
||||
### Runtime Config Updates
|
||||
|
||||
|
||||
Reference in New Issue
Block a user