(ctx context.Context, ref reference.Named, repo distribution.Repository, mfst schema2.DeserializedManifest)
| 69 | } |
| 70 | |
| 71 | func pullManifestSchemaV2(ctx context.Context, ref reference.Named, repo distribution.Repository, mfst schema2.DeserializedManifest) (types.ImageManifest, error) { |
| 72 | manifestDesc, err := validateManifestDigest(ref, mfst) |
| 73 | if err != nil { |
| 74 | return types.ImageManifest{}, err |
| 75 | } |
| 76 | configJSON, err := pullManifestSchemaV2ImageConfig(ctx, mfst.Target().Digest, repo) |
| 77 | if err != nil { |
| 78 | return types.ImageManifest{}, err |
| 79 | } |
| 80 | |
| 81 | if manifestDesc.Platform == nil { |
| 82 | manifestDesc.Platform = &ocispec.Platform{} |
| 83 | } |
| 84 | |
| 85 | // Fill in os and architecture fields from config JSON |
| 86 | if err := json.Unmarshal(configJSON, manifestDesc.Platform); err != nil { |
| 87 | return types.ImageManifest{}, err |
| 88 | } |
| 89 | |
| 90 | return types.NewImageManifest(ref, manifestDesc, &mfst), nil |
| 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) |
no test coverage detected
searching dependent graphs…