From d89b612e3de8a72aa30532e47574d3072cb07d84 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 24 Apr 2020 10:56:10 +0200 Subject: [PATCH] Fix updates config handling --- updates/config.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/updates/config.go b/updates/config.go index 86d78a2f..9852aa5e 100644 --- a/updates/config.go +++ b/updates/config.go @@ -61,9 +61,13 @@ func registerConfig() error { func initConfig() { releaseChannel = config.GetAsString(releaseChannelKey, releaseChannelStable) - disableUpdates = config.GetAsBool(disableUpdatesKey, false) + previousReleaseChannel = releaseChannel() - devMode = config.GetAsBool("core/devMode", false) + disableUpdates = config.GetAsBool(disableUpdatesKey, false) + updatesCurrentlyDisabled = disableUpdates() + + devMode = config.GetAsBool(cfgDevModeKey, false) + previousDevMode = devMode() } func updateRegistryConfig(_ context.Context, _ interface{}) error { @@ -96,8 +100,8 @@ func updateRegistryConfig(_ context.Context, _ interface{}) error { module.Resolve(updateFailed) _ = TriggerUpdate() log.Infof("updates: automatic updates enabled again.") - } else { - module.Warning(updateFailed, "Updates are disabled!") + } else if updatesCurrentlyDisabled { + module.Warning(updateFailed, "Automatic updates are disabled! This also affects security updates and threat intelligence.") log.Warningf("updates: automatic updates are now disabled.") } }