(ctx context.Context, client *containerd.Client, srcRef string, platMC platforms.MatchComparer, ongoing *jobs.Jobs)
| 287 | } |
| 288 | |
| 289 | func addDescriptorsToJobs(ctx context.Context, client *containerd.Client, srcRef string, platMC platforms.MatchComparer, ongoing *jobs.Jobs) error { |
| 290 | imageService := client.ImageService() |
| 291 | img, err := imageService.Get(ctx, srcRef) |
| 292 | if err != nil { |
| 293 | return err |
| 294 | } |
| 295 | |
| 296 | provider := containerdutil.NewProvider(client) |
| 297 | handler := images.ChildrenHandler(provider) |
| 298 | if platMC != nil { |
| 299 | handler = images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { |
| 300 | if desc.Platform != nil && !platMC.Match(*desc.Platform) { |
| 301 | return nil, nil |
| 302 | } |
| 303 | return images.Children(ctx, provider, desc) |
| 304 | }) |
| 305 | } |
| 306 | |
| 307 | return images.Walk(ctx, images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { |
| 308 | ongoing.Add(desc) |
| 309 | return handler(ctx, desc) |
| 310 | }), img.Target) |
| 311 | } |
| 312 | |
| 313 | func getESGZConvertOpts(options types.ImageConvertOptions) ([]estargz.Option, error) { |
| 314 |
no test coverage detected
searching dependent graphs…