MCPcopy
hub / github.com/containerd/containerd / getPlatformManifest

Function getPlatformManifest

integration/client/export_test.go:322–346  ·  view source on GitHub ↗
(ctx context.Context, cs content.Store, target ocispec.Descriptor, platform platforms.MatchComparer)

Source from the content-addressed store, hash-verified

320}
321
322func getPlatformManifest(ctx context.Context, cs content.Store, target ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Descriptor, error) {
323 mfst, err := images.LimitManifests(images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
324 children, err := images.Children(ctx, cs, desc)
325 if !images.IsManifestType(desc.MediaType) {
326 return children, err
327 }
328
329 if err != nil {
330 if errdefs.IsNotFound(err) {
331 return nil, images.ErrSkipDesc
332 }
333 return nil, err
334 }
335
336 return children, nil
337 }), platform, 1)(ctx, target)
338
339 if err != nil {
340 return ocispec.Descriptor{}, err
341 }
342 if len(mfst) == 0 {
343 return ocispec.Descriptor{}, errdefs.ErrNotFound
344 }
345 return mfst[0], nil
346}
347
348func assertOCITar(t *testing.T, r io.Reader, docker bool) {
349 t.Helper()

Callers 1

TestExportAllCasesFunction · 0.85

Calls 4

LimitManifestsFunction · 0.92
HandlerFuncFuncType · 0.92
ChildrenFunction · 0.92
IsManifestTypeFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…