From 4423fc6232e7df607cf8e783ff90479b05a5d51d Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Fri, 27 Sep 2024 13:22:07 +0300 Subject: [PATCH] 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 --- dangerzone/isolation_provider/container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dangerzone/isolation_provider/container.py b/dangerzone/isolation_provider/container.py index 76c4aa047..099c15bab 100644 --- a/dangerzone/isolation_provider/container.py +++ b/dangerzone/isolation_provider/container.py @@ -194,7 +194,7 @@ def is_container_installed() -> bool: """ # 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 @@ def is_container_installed() -> bool: ) 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