[DAEMON-15] appcd-config: Runtime config updates
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2017-02-14T04:13:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Appc Daemon 1.0.0 |
Components | appcd-core |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2016-05-05T07:41:05.000+0000 |
Updated | 2017-02-17T06:20:11.000+0000 |
Description
The appc daemon's configuration is currently read-only. It cannot be changed at runtime.
However, it may be desirable to update settings without restarting the daemon. Restarting the daemon means that state will be lost.
Not all config settings should be changeable at runtime. For example, the pidFile should remain read-only, but the proxy settings should be allowed to change.
This should be implemented by listening to SIGHUP as well as exposing a dispatcher and web route to reload the config. If any read-only property is changed, then the entire config reload is rejected.
This was actually completed back in 2017 Sprint 02 Tooling in the commit: https://github.com/cb1kenobi/appc-daemon/commit/a4cac50c593e018ed41a0dd49ad8e5223f23bd5d. The daemon has a micro-package called
appcd-config
which allows config options to have metadata where the values can be marked as readonly. It also allows config value datatypes to be defined so values that are read-in as strings can be coerced into the appropriate datatype.