From f2ca63965209ea73fbcf574f0563dfe701340696 Mon Sep 17 00:00:00 2001 From: Santiago Arboleda Date: Tue, 17 Dec 2024 17:48:39 -0500 Subject: [PATCH] change image base name --- .../src/infrastructure/driven_adapters/docker/docker_images.py | 2 +- .../infrastructure/driven_adapters/docker/test_docker_images.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/devsecops_engine_tools/engine_sca/engine_container/src/infrastructure/driven_adapters/docker/docker_images.py b/tools/devsecops_engine_tools/engine_sca/engine_container/src/infrastructure/driven_adapters/docker/docker_images.py index 4cdbbb62..d5d91f1c 100755 --- a/tools/devsecops_engine_tools/engine_sca/engine_container/src/infrastructure/driven_adapters/docker/docker_images.py +++ b/tools/devsecops_engine_tools/engine_sca/engine_container/src/infrastructure/driven_adapters/docker/docker_images.py @@ -37,7 +37,7 @@ def get_base_image(self, matching_image): client = docker.from_env() image_details = client.api.inspect_image(matching_image.id) labels = image_details.get("Config", {}).get("Labels", {}) - source_image = labels.get("source-image") + source_image = labels.get("x86.image.name") if source_image: logger.info(f"Base image for '{matching_image}' from source-image label: {source_image}") return source_image diff --git a/tools/devsecops_engine_tools/engine_sca/engine_container/test/infrastructure/driven_adapters/docker/test_docker_images.py b/tools/devsecops_engine_tools/engine_sca/engine_container/test/infrastructure/driven_adapters/docker/test_docker_images.py index eb730696..b7c15c26 100755 --- a/tools/devsecops_engine_tools/engine_sca/engine_container/test/infrastructure/driven_adapters/docker/test_docker_images.py +++ b/tools/devsecops_engine_tools/engine_sca/engine_container/test/infrastructure/driven_adapters/docker/test_docker_images.py @@ -120,7 +120,7 @@ def test_get_base_image_source_label(mock_docker_client): matching_image.id = "image_id" mock_client.api.inspect_image.return_value = { - "Config": {"Labels": {"source-image": "source_image:1.0"}}, + "Config": {"Labels": {"x86.image.name": "source_image:1.0"}}, } result = docker_images.get_base_image(matching_image)