test: add more tests for GCing indexes referencing other indexes referencing manifests (#2716)

Looks like we didn't have many GC tests for retaining multiarch images.
I added more data to the existing image retention tests, besides the new GC tests.

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2024-10-11 20:31:48 +03:00
committed by GitHub
parent c89be3ad31
commit a10c5fa7ab
2 changed files with 473 additions and 3 deletions
+8
View File
@@ -37,6 +37,14 @@ func (mi *MultiarchImage) DigestStr() string {
return mi.Digest().String()
}
func (mi *MultiarchImage) DescriptorRef() *ispec.Descriptor {
return &ispec.Descriptor{
MediaType: mi.IndexDescriptor.MediaType,
Digest: mi.IndexDescriptor.Digest,
Size: mi.IndexDescriptor.Size,
}
}
func (mi *MultiarchImage) DigestForAlgorithm(digestAlgorithm godigest.Algorithm) godigest.Digest {
blob, err := json.Marshal(mi.Index)
if err != nil {