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

Function pullManifestSchemaV2ImageConfig

internal/registryclient/fetcher.go:115–130  ·  view source on GitHub ↗
(ctx context.Context, dgst digest.Digest, repo distribution.Repository)

Source from the content-addressed store, hash-verified

113}
114
115func pullManifestSchemaV2ImageConfig(ctx context.Context, dgst digest.Digest, repo distribution.Repository) ([]byte, error) {
116 blobs := repo.Blobs(ctx)
117 configJSON, err := blobs.Get(ctx, dgst)
118 if err != nil {
119 return nil, err
120 }
121
122 verifier := dgst.Verifier()
123 if _, err := verifier.Write(configJSON); err != nil {
124 return nil, err
125 }
126 if !verifier.Verified() {
127 return nil, fmt.Errorf("image config verification failed for digest %s", dgst)
128 }
129 return configJSON, nil
130}
131
132// validateManifestDigest computes the manifest digest, and, if pulling by
133// digest, ensures that it matches the requested digest.

Callers 2

pullManifestSchemaV2Function · 0.85
pullManifestOCISchemaFunction · 0.85

Calls 3

BlobsMethod · 0.80
GetMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…