mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 10:01:55 +00:00
This commit changes the way the source for a delta is determined. We used to do it by comparing the available tags with the one we want and relying on the format that includes the app in the image name. Now we explicitly choose a delta source from the previous app version if we have one, and otherwise use the image from any available app - which will allow us to have a valid source when moving a device between apps. For this to work consistently if there's an unexpected reboot, we now avoid deleting an app from the db until the full update has succeeded. Instead, we mark the app for deletion so that we still have the image stored after the reboot. This commit also changes a .map to .mapSeries when iterating over appIds for removal/install/update - this avoids parallel treatment of apps which can cause inconsistencies in the status reported to the API. Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>