fix(image): correct type annotation and remove dead exception handler

- Fix CheckReportImage metadata parameter type from dict to str
- Remove redundant re-raise of already-handled exceptions
This commit is contained in:
Andoni A.
2026-02-13 10:40:28 +01:00
parent 4af9bc99bf
commit 56535e5b24
2 changed files with 2 additions and 4 deletions
+2 -2
View File
@@ -870,7 +870,7 @@ class CheckReportImage(Check_Report):
def __init__(
self,
metadata: Optional[dict] = None,
metadata: Optional[str] = None,
finding: Optional[dict] = None,
image_name: str = "",
) -> None:
@@ -878,7 +878,7 @@ class CheckReportImage(Check_Report):
Initialize the Container Image Check's finding information from a Trivy vulnerability/secret dict.
Args:
metadata (Dict): Check metadata.
metadata (str): Check metadata.
finding (dict): A single vulnerability/secret result from Trivy's JSON output.
image_name (str): The container image name being scanned.
"""
@@ -173,8 +173,6 @@ class ImageProvider(Provider):
file=file_path,
message=f"Image list file not found: {file_path}",
)
except (ImageListFileReadError, ImageListFileNotFoundError):
raise
except Exception as error:
raise ImageListFileReadError(
file=file_path,