forked from elastic/elastic-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track upgrade details (elastic#3527)
* Remove context and handle cancellation internally instead * More optimizations * Add back context * Adding FSM for upgrades * Implementing TODO * WIP * WIP * Reorganizing imports * Running go mod tidy * Resolve deadlock * Add unit tests * Fix type * Renaming variable to avoid conflict with package name * Handle failures in one place * Set UPG_RESTARTING state * Remove Fleet changes * Add guard for action * Immediately notify observer when registered * Add UpgradeCompleted effect to observer doc * Fix initialization * Adding details progress observer and unit tests * Fixing booboos introduced during conflict resolution * Add unit test * Add assertion on error * Add comment on stateNeedsRefresh * Add comment linking to Fleet Server OpenAPI spec for UPG_* values * Use public accessor for setting upgrade details on coordinator to prevent data race * Use buffered channel for upgradeDetailsChan in test so test can run in single goroutine * Fixing unit test * Add mutex to prevent data race * Clarify assertion's intent * Make copy of details before notifying observer with it. * Add setter for setting download percent * Remove unnecessary struct tags * Change mutex type * Document FailedState and ErrorMsg fields * Track download rate as well * Change data type of time field * Rename struct to avoid stutter in naming * Log upgrade details when they change * Add nil guard * Setting logger in test * Use sentinel value for encoding +Inf download rate in JSON * Fix up comment * Set omitempty on failed_state and error_msg * Add units to download rate
- Loading branch information
1 parent
e43be2a
commit 92acf08
Showing
18 changed files
with
547 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.