Skip to content

Commit

Permalink
test: add image id
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 committed Jun 19, 2024
1 parent 90a24f2 commit 50f2d0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/report/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (sw *SarifWriter) Write(ctx context.Context, report types.Report) error {
"imageName": report.ArtifactName,
"repoTags": report.Metadata.RepoTags,
"repoDigests": report.Metadata.RepoDigests,
"imageID": report.Metadata.ImageID
"imageID": report.Metadata.ImageID,
}
}
if sw.Target != "" {
Expand Down
2 changes: 2 additions & 0 deletions pkg/report/sarif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func TestReportWriter_Sarif(t *testing.T) {
ArtifactName: "debian:9",
ArtifactType: ftypes.ArtifactContainerImage,
Metadata: types.Metadata{
ImageID: "sha256:7640c3f9e75002deb419d5e32738eeff82cf2b3edca3781b4fe1f1f626d11b20",
RepoTags: []string{
"debian:9",
},
Expand Down Expand Up @@ -175,6 +176,7 @@ func TestReportWriter_Sarif(t *testing.T) {
PropertyBag: sarif.PropertyBag{
Properties: map[string]interface{}{
"imageName": "debian:9",
"imageID": "sha256:7640c3f9e75002deb419d5e32738eeff82cf2b3edca3781b4fe1f1f626d11b20",
"repoDigests": []interface{}{"debian@sha256:a8cc1744bbdd5266678e3e8b3e6387e45c053218438897e86876f2eb104e5534"},
"repoTags": []interface{}{"debian:9"},
},
Expand Down

0 comments on commit 50f2d0b

Please sign in to comment.