Add sha256: to images history id for docker compatibility

Fixes: https://github.com/containers/podman/issues/17762

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-04-24 15:18:07 -04:00
parent 846e7aa21b
commit edaf3b4d5e
3 changed files with 16 additions and 4 deletions

View File

@ -70,12 +70,11 @@ class TestImages(common.DockerTestCase):
"""Image history"""
img = self.docker.images.get(constant.ALPINE)
history = img.history()
image_id = img.id[7:] if img.id.startswith("sha256:") else img.id
found = False
for change in history:
found |= image_id in change.values()
self.assertTrue(found, f"image id {image_id} not found in history")
found |= img.id in change.values()
self.assertTrue(found, f"image id {img.id} not found in history")
def test_get_image_exists_not(self):
"""Negative test for get image"""