MCPcopy Create free account
hub / github.com/docker/cli / pullManifestOCISchema

Function pullManifestOCISchema

internal/registryclient/fetcher.go:93–113  ·  view source on GitHub ↗
(ctx context.Context, ref reference.Named, repo distribution.Repository, mfst ocischema.DeserializedManifest)

Source from the content-addressed store, hash-verified

91}
92
93func 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
115func pullManifestSchemaV2ImageConfig(ctx context.Context, dgst digest.Digest, repo distribution.Repository) ([]byte, error) {
116 blobs := repo.Blobs(ctx)

Callers 2

fetchManifestFunction · 0.85
pullManifestListFunction · 0.85

Calls 2

validateManifestDigestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…