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

Function fetchManifest

internal/registryclient/fetcher.go:26–42  ·  view source on GitHub ↗

fetchManifest pulls a manifest from a registry and returns it. An error is returned if no manifest is found matching namedRef.

(ctx context.Context, repo distribution.Repository, ref reference.Named)

Source from the content-addressed store, hash-verified

24// fetchManifest pulls a manifest from a registry and returns it. An error
25// is returned if no manifest is found matching namedRef.
26func fetchManifest(ctx context.Context, repo distribution.Repository, ref reference.Named) (types.ImageManifest, error) {
27 manifest, err := getManifest(ctx, repo, ref)
28 if err != nil {
29 return types.ImageManifest{}, err
30 }
31
32 switch v := manifest.(type) {
33 // Removed Schema 1 support
34 case *schema2.DeserializedManifest:
35 return pullManifestSchemaV2(ctx, ref, repo, *v)
36 case *ocischema.DeserializedManifest:
37 return pullManifestOCISchema(ctx, ref, repo, *v)
38 case *manifestlist.DeserializedManifestList:
39 return types.ImageManifest{}, fmt.Errorf("%s is a manifest list", ref)
40 }
41 return types.ImageManifest{}, fmt.Errorf("%s is not a manifest", ref)
42}
43
44func fetchList(ctx context.Context, repo distribution.Repository, ref reference.Named) ([]types.ImageManifest, error) {
45 manifest, err := getManifest(ctx, repo, ref)

Callers 1

GetManifestMethod · 0.85

Calls 3

pullManifestSchemaV2Function · 0.85
pullManifestOCISchemaFunction · 0.85
getManifestFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…