(ctx context.Context, ref reference.Named, repo distribution.Repository, mfst ocischema.DeserializedManifest)
| 91 | } |
| 92 | |
| 93 | func pullManifestOCISchema(ctx context.Context, ref reference.Named, repo distribution.Repository, mfst ocischema.DeserializedManifest) (types.ImageManifest, error) { |
| 94 | manifestDesc, err := validateManifestDigest(ref, mfst) |
| 95 | if err != nil { |
| 96 | return types.ImageManifest{}, err |
| 97 | } |
| 98 | configJSON, err := pullManifestSchemaV2ImageConfig(ctx, mfst.Target().Digest, repo) |
| 99 | if err != nil { |
| 100 | return types.ImageManifest{}, err |
| 101 | } |
| 102 | |
| 103 | if manifestDesc.Platform == nil { |
| 104 | manifestDesc.Platform = &ocispec.Platform{} |
| 105 | } |
| 106 | |
| 107 | // Fill in os and architecture fields from config JSON |
| 108 | if err := json.Unmarshal(configJSON, manifestDesc.Platform); err != nil { |
| 109 | return types.ImageManifest{}, err |
| 110 | } |
| 111 | |
| 112 | return types.NewOCIImageManifest(ref, manifestDesc, &mfst), nil |
| 113 | } |
| 114 | |
| 115 | func pullManifestSchemaV2ImageConfig(ctx context.Context, dgst digest.Digest, repo distribution.Repository) ([]byte, error) { |
| 116 | blobs := repo.Blobs(ctx) |
no test coverage detected
searching dependent graphs…