From 9c89da21455346ac1e4e4080f5f24e2214ca7ed8 Mon Sep 17 00:00:00 2001 From: Pavel Nakonechnyi Date: Thu, 17 Oct 2024 16:54:46 +0200 Subject: [PATCH] tools: trivy_operator: support images referenced by digest instead of tag --- dojo/tools/trivy_operator/parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dojo/tools/trivy_operator/parser.py b/dojo/tools/trivy_operator/parser.py index 83270ad95f..e8ea85d281 100644 --- a/dojo/tools/trivy_operator/parser.py +++ b/dojo/tools/trivy_operator/parser.py @@ -70,7 +70,9 @@ def handle_resource(self, data, test): registry = report.get("registry").get("server", "unknown_registry") artifact = report.get("artifact") repository = artifact.get("repository", "unknown_repo") - tag = artifact.get("tag", "unknown_tag") + tag = artifact.get("tag", "") + if tag == "": + tag = artifact.get("digest", "unknown_tag") # having full path to an image (forward slashes) and a tag # after colon as 'host' property of Endpoint makes an # endpoint broken, although, this is a desired value. Thus,