From 466f7d4e1e6ef60d0ab63be3505ed49419a7f9ec Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 26 Jan 2021 14:31:17 +0100 Subject: [PATCH] changelog --- x-pack/elastic-agent/pkg/agent/application/upgrade/upgrade.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/elastic-agent/pkg/agent/application/upgrade/upgrade.go b/x-pack/elastic-agent/pkg/agent/application/upgrade/upgrade.go index 8c2bfb949f38..9b7a271a9d74 100644 --- a/x-pack/elastic-agent/pkg/agent/application/upgrade/upgrade.go +++ b/x-pack/elastic-agent/pkg/agent/application/upgrade/upgrade.go @@ -250,14 +250,13 @@ func copyActionStore(newHash string) error { storePaths := []string{info.AgentActionStoreFile(), info.AgentStateStoreFile()} for _, currentActionStorePath := range storePaths { - newHome := filepath.Join(filepath.Dir(paths.Home()), fmt.Sprintf("%s-%s", agentName, newHash)) newActionStorePath := filepath.Join(newHome, filepath.Base(currentActionStorePath)) currentActionStore, err := ioutil.ReadFile(currentActionStorePath) if os.IsNotExist(err) { // nothing to copy - return nil + continue } if err != nil { return err