File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
internal/testing/testdata
pkg/ingestor/parser/cyclonedx Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1127,6 +1127,16 @@ var (
11271127 }
11281128
11291129 CdxIngestionPredicates = assembler.IngestPredicates {
1130+ IsOccurrence : []assembler.IsOccurrenceIngest {
1131+ {
1132+ Pkg : cdxTopLevelPack ,
1133+ Artifact : & model.ArtifactInputSpec {
1134+ Algorithm : "sha256" ,
1135+ Digest : "6ad5b696af3ca05a048bd29bf0f623040462638cb0b29c8d702cbb2805687388" ,
1136+ },
1137+ IsOccurrence : isOccurrenceJustifyTopPkg ,
1138+ },
1139+ },
11301140 IsDependency : CdxDeps ,
11311141 HasSBOM : CdxHasSBOM ,
11321142 }
Original file line number Diff line number Diff line change @@ -387,6 +387,8 @@ func (c *cyclonedxParser) GetPredicates(ctx context.Context) *assembler.IngestPr
387387 logger .Infof ("CDX artifact was not parsable: %v" , err )
388388 } else {
389389 topLevelArts = append (topLevelArts , artInput )
390+ // append to packageArtifacts so that isOccurrence is created
391+ c .packageArtifacts [c .cdxBom .Metadata .Component .BOMRef ] = append (c .packageArtifacts [c .cdxBom .Metadata .Component .BOMRef ], artInput )
390392 logger .Infof ("getArtInput %v" , artInput )
391393 }
392394 }
You can’t perform that action at this time.
0 commit comments