MCPcopy Create free account
hub / github.com/containers/image / GetManifest

Method GetManifest

docker/docker_image_src.go:227–239  ·  view source on GitHub ↗

GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). It may use a remote (= slow) service. If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary m

(ctx context.Context, instanceDigest *digest.Digest)

Source from the content-addressed store, hash-verified

225// If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list);
226// this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists).
227func (s *dockerImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) {
228 if instanceDigest != nil {
229 if err := instanceDigest.Validate(); err != nil { // Make sure instanceDigest.String() does not contain any unexpected characters
230 return nil, "", err
231 }
232 return s.fetchManifest(ctx, instanceDigest.String())
233 }
234 err := s.ensureManifestIsLoaded(ctx)
235 if err != nil {
236 return nil, "", err
237 }
238 return s.cachedManifest, s.cachedManifestMIMEType, nil
239}
240
241// fetchManifest fetches a manifest for tagOrDigest.
242// The caller is responsible for ensuring tagOrDigest uses the expected format.

Callers

nothing calls this directly

Calls 3

fetchManifestMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected