Commit Graph

4 Commits

Author SHA1 Message Date
Miloslav Trmač c02e858208 Use assert.ElementsMatch instead of manually copying+sorting
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-09-05 19:44:50 +02:00
Miloslav Trmač 9538e3503b Use generics in readAllImageStores
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-04-18 21:25:04 +02:00
Miloslav Trmač 77bd99c0fc Use generics in readAllLayerStores
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-04-18 21:24:30 +02:00
Nalin Dahyabhai 92c4efc26e Initial implementation of consistency checks
Add initial Check() and Repair() methods to Stores.

Check() checks for inconsistencies between the layers which the
lower-level storage driver claims to know about and the ones which we
know we're managing.  It checks that layers referenced by layers,
images, and containers are known to us and that images referenced by
containers are known to us.  It checks that data which we store
alongside layers, images, and containers is still present, and to the
extent which we store other information about that data (frequenly just
the size of the data), verifies that it matches recorded expectations.
Lastly, it checks that layers which are part of images (and which we
therefore know what they should have in them) have the expected content,
and nothing else.

Repair() removes any containers, images, and layers which have any
errors associated with them.  This is destructive, so its use should be
considered and deliberate.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-04-13 10:38:24 -04:00