@@ -126,6 +126,8 @@ var (
126126 testBlobBChunk2Length string
127127 testBlobBChunk1Range string
128128 testBlobBChunk2Range string
129+ testAnnotationKey string
130+ testAnnotationValues map [string ]string
129131 client * reggie.Client
130132 crossmountNamespace string
131133 dummyDigest string
@@ -336,6 +338,9 @@ func init() {
336338
337339 testRefArtifactTypeB = "application/vnd.nba.strawberry.jam.croissant"
338340
341+ testAnnotationKey = "org.opencontainers.conformance.test"
342+ testAnnotationValues = map [string ]string {}
343+
339344 // artifact with Subject ref using config.MediaType = artifactType
340345 refsManifestAConfigArtifact := manifest {
341346 SchemaVersion : 2 ,
@@ -353,6 +358,9 @@ func init() {
353358 Layers : []descriptor {
354359 emptyJSONDescriptor ,
355360 },
361+ Annotations : map [string ]string {
362+ testAnnotationKey : "test config a" ,
363+ },
356364 }
357365
358366 refsManifestAConfigArtifactContent , err = json .MarshalIndent (& refsManifestAConfigArtifact , "" , "\t " )
@@ -361,6 +369,7 @@ func init() {
361369 }
362370
363371 refsManifestAConfigArtifactDigest = godigest .FromBytes (refsManifestAConfigArtifactContent ).String ()
372+ testAnnotationValues [refsManifestAConfigArtifactDigest ] = refsManifestAConfigArtifact .Annotations [testAnnotationKey ]
364373
365374 refsManifestBConfigArtifact := manifest {
366375 SchemaVersion : 2 ,
@@ -378,6 +387,9 @@ func init() {
378387 Layers : []descriptor {
379388 emptyJSONDescriptor ,
380389 },
390+ Annotations : map [string ]string {
391+ testAnnotationKey : "test config b" ,
392+ },
381393 }
382394
383395 refsManifestBConfigArtifactContent , err = json .MarshalIndent (& refsManifestBConfigArtifact , "" , "\t " )
@@ -386,6 +398,7 @@ func init() {
386398 }
387399
388400 refsManifestBConfigArtifactDigest = godigest .FromBytes (refsManifestBConfigArtifactContent ).String ()
401+ testAnnotationValues [refsManifestBConfigArtifactDigest ] = refsManifestBConfigArtifact .Annotations [testAnnotationKey ]
389402
390403 // artifact with Subject ref using ArtifactType, config.MediaType = emptyJSON
391404 refsManifestALayerArtifact := manifest {
@@ -405,6 +418,9 @@ func init() {
405418 Digest : godigest .FromBytes (testRefBlobA ),
406419 },
407420 },
421+ Annotations : map [string ]string {
422+ testAnnotationKey : "test layer a" ,
423+ },
408424 }
409425
410426 refsManifestALayerArtifactContent , err = json .MarshalIndent (& refsManifestALayerArtifact , "" , "\t " )
@@ -413,6 +429,7 @@ func init() {
413429 }
414430
415431 refsManifestALayerArtifactDigest = godigest .FromBytes (refsManifestALayerArtifactContent ).String ()
432+ testAnnotationValues [refsManifestALayerArtifactDigest ] = refsManifestALayerArtifact .Annotations [testAnnotationKey ]
416433
417434 refsManifestBLayerArtifact := manifest {
418435 SchemaVersion : 2 ,
@@ -431,6 +448,9 @@ func init() {
431448 Digest : godigest .FromBytes (testRefBlobB ),
432449 },
433450 },
451+ Annotations : map [string ]string {
452+ testAnnotationKey : "test layer b" ,
453+ },
434454 }
435455
436456 refsManifestBLayerArtifactContent , err = json .MarshalIndent (& refsManifestBLayerArtifact , "" , "\t " )
@@ -439,6 +459,7 @@ func init() {
439459 }
440460
441461 refsManifestBLayerArtifactDigest = godigest .FromBytes (refsManifestBLayerArtifactContent ).String ()
462+ testAnnotationValues [refsManifestBLayerArtifactDigest ] = refsManifestBLayerArtifact .Annotations [testAnnotationKey ]
442463
443464 testRefArtifactTypeIndex = "application/vnd.food.stand"
444465 refsIndexArtifact := index {
@@ -462,12 +483,16 @@ func init() {
462483 Size : int64 (len (manifests [4 ].Content )),
463484 Digest : godigest .FromBytes (manifests [4 ].Content ),
464485 },
486+ Annotations : map [string ]string {
487+ testAnnotationKey : "test index" ,
488+ },
465489 }
466490 refsIndexArtifactContent , err = json .MarshalIndent (& refsIndexArtifact , "" , "\t " )
467491 if err != nil {
468492 log .Fatal (err )
469493 }
470494 refsIndexArtifactDigest = godigest .FromBytes (refsIndexArtifactContent ).String ()
495+ testAnnotationValues [refsIndexArtifactDigest ] = refsIndexArtifact .Annotations [testAnnotationKey ]
471496
472497 dummyDigest = godigest .FromString ("hello world" ).String ()
473498
0 commit comments