From 0b144daabf8c2efcb6f50dbbbdd6516b549327a6 Mon Sep 17 00:00:00 2001 From: Pierre-Jean TEXIER Date: Tue, 27 Mar 2018 23:03:09 +0200 Subject: [PATCH] fixes load and update of UpgradeToInstallation variable Without this commit, the agent code reading 'UpgradeToInstallation' from '/etc/updatehub.conf' and not from persistents data (/data) Also fixes the update of 'UpgradeToInstallation' after an update. Fixes #197 Signed-off-by: Pierre-Jean TEXIER --- cmd/updatehub/main.go | 1 + updatehub/updatehub.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/updatehub/main.go b/cmd/updatehub/main.go index a2fac027..22bb1822 100644 --- a/cmd/updatehub/main.go +++ b/cmd/updatehub/main.go @@ -94,6 +94,7 @@ func main() { } settings.PersistentPollingSettings = runtimeSettings.PersistentPollingSettings + settings.PersistentUpdateSettings = runtimeSettings.PersistentUpdateSettings log.Info("starting UpdateHub Agent") log.Info(" version: ", gitversion) diff --git a/updatehub/updatehub.go b/updatehub/updatehub.go index 922f6f9b..129527ca 100644 --- a/updatehub/updatehub.go +++ b/updatehub/updatehub.go @@ -496,6 +496,7 @@ func (uh *UpdateHub) InstallUpdate(updateMetadata *metadata.UpdateMetadata, prog } log.Info("ActiveInactive activated: ", indexToInstall) + uh.Settings.UpgradeToInstallation = indexToInstall } log.Info("update installed successfully")