@@ -27,6 +27,7 @@ import (
2727 "github.com/testcontainers/testcontainers-go"
2828 "github.com/testcontainers/testcontainers-go/wait"
2929
30+ "github.com/aquasecurity/trivy/internal/testutil"
3031 "github.com/aquasecurity/trivy/pkg/types"
3132)
3233
@@ -249,7 +250,7 @@ func TestRegistry(t *testing.T) {
249250 runTest (t , osArgs , tt .golden , types .FormatJSON , runOptions {
250251 wantErr : tt .wantErr ,
251252 fakeUUID : "3ff14136-e09f-4df9-80ea-%012d" ,
252- override : overrideFuncs (overrideUID , func (_ * testing.T , want , got * types.Report ) {
253+ override : overrideFuncs (overrideUID , func (t * testing.T , want , got * types.Report ) {
253254 // Exclude ArtifactID from comparison because registry tests use random ports
254255 // (e.g., localhost:54321/alpine:3.10), which causes RepoTags and the calculated
255256 // Artifact ID to vary on each test run.
@@ -258,6 +259,7 @@ func TestRegistry(t *testing.T) {
258259
259260 want .ArtifactName = s
260261 want .Metadata .RepoTags = []string {s }
262+ want .Metadata .Reference = testutil .MustParseReference (t , s )
261263 for i := range want .Results {
262264 want .Results [i ].Target = fmt .Sprintf ("%s (%s)" , s , tt .os )
263265 }
0 commit comments