(ctx context.Context, cs content.Store, target ocispec.Descriptor, platform platforms.MatchComparer)
| 320 | } |
| 321 | |
| 322 | func 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 | |
| 348 | func assertOCITar(t *testing.T, r io.Reader, docker bool) { |
| 349 | t.Helper() |
no test coverage detected
searching dependent graphs…