Handle multiple image IDs in the image-ids.txt file.

Docker Desktop 4.30.0 uses the containerd image store by default, which
generates different IDs for the images, and as a result breaks the logic
we are using when verifying the images IDs are present.

Now, multiple IDs can be stored in the `image-id.txt` file.

Fixes #933
This commit is contained in:
Alex Pyrgiotis 2024-09-27 13:22:07 +03:00 committed by Alexis Métaireau
parent bd2dc0ea3c
commit 4423fc6232
No known key found for this signature in database
GPG key ID: C65C7A89A8FFC56E

View file

@ -194,7 +194,7 @@ class Container(IsolationProvider):
"""
# Get the image id
with open(get_resource_path("image-id.txt")) as f:
expected_image_id = f.read().strip()
expected_image_ids = f.read().strip().split()
# See if this image is already installed
installed = False
@ -212,7 +212,7 @@ class Container(IsolationProvider):
)
found_image_id = found_image_id.strip()
if found_image_id == expected_image_id:
if found_image_id in expected_image_ids:
installed = True
elif found_image_id == "":
pass