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

Function pullManifestSchemaV2

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

Source from the content-addressed store, hash-verified

69}
70
71func 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
93func pullManifestOCISchema(ctx context.Context, ref reference.Named, repo distribution.Repository, mfst ocischema.DeserializedManifest) (types.ImageManifest, error) {
94 manifestDesc, err := validateManifestDigest(ref, mfst)

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…