(ctx context.Context, dgst digest.Digest, repo distribution.Repository)
| 113 | } |
| 114 | |
| 115 | func 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. |
no test coverage detected
searching dependent graphs…