balena-supervisor/test/lib
Felipe Lalanne f1bd4b8d9b Use tags to track supervised images in docker
The image manager module now uses tags instead of docker IDs as the main
way to identify docker images on the engine. That is, if the target
state image has a name `imageName:tag@digest`, the supervisor will always use
the given `imageName` and `tag` (which may be empty) to tag the image on
the engine after fetching. This PR also adds checkups to ensure
consistency is maintained between the database and the engine.

Using tags allows to simplify query and removal operations, since now
removing the image now means removing tags matching the image name.

Before this change the supervisor relied only on information in the
supervisor database, and used that to remove images by docker ID. However, the docker
id is not a reliable identifier, since images retain the same id between
releases or between services in the same release.

List of squashed commits
- Remove custom type NormalizedImageInfo
- Remove dependency on docker-toolbelt
- Use tags to traack supervised images in docker
- Ensure tag removal occurs in sequence
- Only save database image after download confirmed

Relates-to: #1616 #1579
Change-type: patch
2021-07-26 09:52:25 -04:00
..
application-manager-test-states.ts Improve target state typings 2021-06-08 13:45:44 +01:00
application-state-mock.ts Improve testing for supervisor composition modules 2021-07-05 17:50:52 -04:00
db-helper.ts Fix db-helper module for tests 2021-07-08 14:43:13 -04:00
errors.ts Update typed-error to 3.x 2020-08-19 10:07:54 +01:00
helpers.ts Add toggleable SUPERVISOR_HARDWARE_METRICS config 2021-05-13 13:59:07 +09:00
mocked-balena-api.ts api-binder: Convert to a singleton 2020-09-14 09:31:12 +01:00
mocked-database.ts Add more test coverage for compose/images 2020-11-03 13:08:41 -05:00
mocked-dbus.ts Complete /v1/device/host-config unit tests, modify PATCH route 2021-02-18 12:25:44 +09:00
mocked-device-api.ts Remove mz, mkdirp, body-parser dependencies 2021-04-28 07:20:15 +09:00
mocked-dockerode.ts Fix mock dockerode module 2021-04-27 13:00:56 -04:00
mocked-iptables.ts Remove mz, mkdirp, body-parser dependencies 2021-04-28 07:20:15 +09:00
mockerode.ts Use tags to track supervised images in docker 2021-07-26 09:52:25 -04:00
prepare.ts Make the config module a singleton 2020-06-02 14:29:05 +01:00