working commit
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user