From 50f2d0b2bad441a0fa592195e1c6665652a106d0 Mon Sep 17 00:00:00 2001 From: knqyf263 Date: Wed, 19 Jun 2024 12:23:40 +0400 Subject: [PATCH] test: add image id Signed-off-by: knqyf263 --- pkg/report/sarif.go | 2 +- pkg/report/sarif_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/report/sarif.go b/pkg/report/sarif.go index 95b78b254e97..d14db901899b 100644 --- a/pkg/report/sarif.go +++ b/pkg/report/sarif.go @@ -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 != "" { diff --git a/pkg/report/sarif_test.go b/pkg/report/sarif_test.go index fe46514002b6..34da66430cc2 100644 --- a/pkg/report/sarif_test.go +++ b/pkg/report/sarif_test.go @@ -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", }, @@ -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"}, },