working commit

This commit is contained in:
2026-02-24 15:52:31 +02:00
parent e2e4ec1776
commit d6d2721c88
6 changed files with 178 additions and 16 deletions
+7 -2
View File
@@ -21,11 +21,16 @@ import (
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)
const (
oiiMediaType = "application/vnd.oci.image.index.v1+json"
oimMediaType = "application/vnd.oci.image.manifest.v1+json"
)
func indexFromManigestDescrs(manifestDescrs []descr.Manifest) (ocispec.Index, string, error) {
var err error
var payload string
index := ocispec.Index{
MediaType: ocispec.MediaTypeImageIndex,
MediaType: oiiMediaType,
Manifests: make([]ocispec.Descriptor, 0),
}
index.Versioned.SchemaVersion = 2
@@ -42,7 +47,7 @@ func indexFromManigestDescrs(manifestDescrs []descr.Manifest) (ocispec.Index, st
return index, payload, err
}
descriptor := ocispec.Descriptor{
MediaType: ocispec.MediaTypeImageManifest,
MediaType: oimMediaType,
Digest: auxoci.SHA256DigestFromString(manifestDescr.Payload),
Size: int64(len(manifestDescr.Payload)),
Platform: ociManifest.Subject.Platform,