moby/daemon/config
Sebastiaan van Stijn c46e2e85ee
daemon/config: Reload(): add TODO for config reload logic
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>
2022-04-28 09:30:04 +02:00
..
builder.go Add GoDoc to fix linting validation 2019-10-21 21:36:22 +02:00
builder_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
config.go daemon/config: Reload(): add TODO for config reload logic 2022-04-28 09:30:04 +02:00
config_linux.go daemon/config: remove unneeded alias 2022-04-17 13:08:34 +02:00
config_linux_test.go Allow switching Windows runtimes. 2021-09-23 17:44:04 +00:00
config_test.go daemon/config: Validate(): validate log-level 2022-04-27 00:34:14 +02:00
config_windows.go Allow switching Windows runtimes. 2021-09-23 17:44:04 +00:00
config_windows_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
opts.go Add canonical import comment 2018-02-05 16:51:57 -05:00