Skip to content

Artifact class scan method generates type error attempting to retrieve scan_overview #105

Description

@brophyja

When Harbor is configured to run Trivy scans, the Artifact class's scan method generates type errors when attempting to retrieve the scan_overview (e.g. NativeReportSummary).

 /dev/run/ea-harbor/lib64/python3.12/site-packages/harborapi/models/models.py:2813 in scan

   2810     scan overview. This property provides a quick access to it.
   2811     """
   2812     if self.scan_overview and self.scan_overview.root:
 x 2813         return self.scan_overview.root[next(iter(self.scan_overview))]
   2814     return None
   2815     
   2816     


TypeError: unhashable type: 'dict'

Perhaps the retrieval should return the dict values, for example:

2812         if self.scan_overview and self.scan_overview.root:
2813             return self.scan_overview.root[next(iter(self.scan_overview.values()))]
2814         return None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions