[8.18] (backport #9386) Enhancement/5235 upgrade cleans up downloads and extracted agent#10036
Merged
[8.18] (backport #9386) Enhancement/5235 upgrade cleans up downloads and extracted agent#10036
Conversation
* enhancement(5235): added comments describing updates in error handling. returning path in error cases if the download is completed * enhancement(5235): added wrapper var for verifier constructor in download step to improve testability * enhancement(5235): added test for downloadArtifact verifier errors * enhancement(5235): addded cleanupPaths slice. added deferred call to remove paths in the cleanupPaths slice * enhancement(5235): add archive and hash path to cleanup paths after artifact download * enhancement(5235): update error handling after unpack. add new versioned home to cleanup paths enhancement(5235): move newHome declaration * enhancement(5235): added upgrade cleanup test * enhancement(5235): added changelog fragment enhancement(5235): updated changelog fragment * enhancement(5235): fix errors in step_download after rebase * enhancement(5235): fix error in step_download_test after rebase * enhancement(5235): refactor disk space error check and path cleanup into one deferred call * enhancement(5235): refactored verifier factory and updated relevant download tests * enhancement(5235): removed separate test for cleanup, added cleanup checks in error handling test * enhancement(5235): changed function name in verifier * enhancement(5235): using AddHashExtension instead of hard coded hash extension string in upgrader (cherry picked from commit ab23962) # Conflicts: # internal/pkg/agent/application/upgrade/upgrade.go # internal/pkg/agent/application/upgrade/upgrade_test.go
Contributor
Author
|
Cherry-pick of ab23962 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
4 tasks
Contributor
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Contributor
Author
|
This pull request has not been merged yet. Could you please review and merge it @kaanyalti? 🙏 |
Member
|
@kaanyalti can you take a look at this backport? |
@ebeahan I'm going through all the backports today |
|
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsHistory
cc @kaanyalti |
kaanyalti
approved these changes
Sep 24, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




PR 5/6
What does this PR do?
Why is it important?
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added an entry in./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testDisruptive User Impact
none
How to test this PR locally
Related issues
This is an automatic backport of pull request #9386 done by [Mergify](https://mergify.com).