Skip to content

Commit

Permalink
No sbom_overview when sbom is deleted
Browse files Browse the repository at this point in the history
fixes #20529

Signed-off-by: stonezdj <[email protected]>
  • Loading branch information
stonezdj committed Jun 3, 2024
1 parent 30767f6 commit 810994f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/v2.0/handler/assembler/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func (assembler *ScanReportAssembler) Assemble(ctx context.Context) error {
log.Warningf("get scan summary of artifact %s@%s for %s failed, error:%v", artifact.RepositoryName, artifact.Digest, v1.MimeTypeSBOMReport, err)
}
if len(overview) == 0 {
// only fetch the sbom overview from execution when the overview is empty and the artifact has child references ( image index, cnab etc)
if len(artifact.References) == 0 {
continue
}
log.Warningf("overview is empty, retrieve sbom status from execution")
// Get latest execution with digest, repository, and scan type is sbom, the status is the scan status
query := q.New(
Expand Down

0 comments on commit 810994f

Please sign in to comment.