c46e2e85ee
The Reload logic is problematic and needs a rewrite. Currently, config.Reload() is validating newConfig before the reload callback is executed. At that point, newConfig may be a partial configuration, yet to be merged with the existing configuration (in the "reload()" callback). Validating this config before it's merged can result in incorrect validation errors. However, the current "reload()" callback we use is DaemonCli.reloadConfig(), which includes a call to Daemon.Reload(), which both performs "merging" and validation, as well as actually updating the daemon configuration. Calling DaemonCli.reloadConfig() *before* validation, could thus lead to a failure in that function (making the reload non-atomic). While *some* errors could always occur when applying/updating the config, we should make it more atomic, and; 1. get (a copy of) the active configuration 2. get the new configuration 3. apply the (reloadable) options from the new configuration 4. validate the merged results 5. apply the new configuration. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
builder.go | ||
builder_test.go | ||
config.go | ||
config_linux.go | ||
config_linux_test.go | ||
config_test.go | ||
config_windows.go | ||
config_windows_test.go | ||
opts.go |