[Fleet] Refactor package installation / upgrade / downgrade and error recovery / rollback #82007
Labels
Feature:EPM
Fleet team's Elastic Package Manager (aka Integrations) project
Feature:Fleet
Fleet team's agent central management project
Team:Fleet
Team label for Observability Data Collection Fleet team
technical debt
Improvement of the software architecture and operational architecture
Currently, direct package upload only allows the fresh installation of packages. It should support the same functionality of reinstalling, upgrading and downgrading packages as installation from the registry does. This logic is currently implemented in both
installPackageFromRegistry()
(full functionality) andinstallPackageByUpload()
(install only) and should be factored out to a separate function.Related files:
server/services/epm/packages/install.ts
Error recovery and rollback is currently implemented in
handleInstallPackageFailure()
, which is called frominstallPackageFromRegistry()
(and also directly from theinstallPackageFromRegistryHandler()
and possibly other places (security/endpoint?)), and in turn directly calls and is therefore tightly coupled withinstallPackageFromRegistry()
. This needs to be factored out so that all installation methods can use the same function for error recovery and rollback.Related files:
server/services/epm/packages/install.ts
server/routes/epm/handlers.ts
Possible scenarios
Installed package: registry package
New package
registry, newer version: supported, triggers update
registry, same version: supported, triggers reinstall
registry, older version: requires
--force
, triggers downgradeupload, newer version: ?
upload, same version: ?
upload, older version: ?
Installed package: uploaded package
New package
registry, newer version: ?
registry, same version: ?
registry, older version: ?
upload, newer version: supported, triggers update
upload, same version: supported, triggers reinstall
upload, older version: supported, triggers downgrade (package upload has implicit
--force
)The text was updated successfully, but these errors were encountered: