initLocalCRIImageService uses containerd.Client to init CRI plugin. NOTE: We don't need to start the CRI plugin here because we just need the ImageService API.
(client *containerd.Client, tmpDir string, registryCfg criconfig.Registry, useLocalPull bool)
| 506 | // NOTE: We don't need to start the CRI plugin here because we just need the |
| 507 | // ImageService API. |
| 508 | func initLocalCRIImageService(client *containerd.Client, tmpDir string, registryCfg criconfig.Registry, useLocalPull bool) (criserver.ImageService, error) { |
| 509 | containerdRootDir := filepath.Join(tmpDir, "root") |
| 510 | |
| 511 | cfg := criconfig.ImageConfig{ |
| 512 | Snapshotter: defaults.DefaultSnapshotter, |
| 513 | Registry: registryCfg, |
| 514 | ImagePullProgressTimeout: defaultImagePullProgressTimeout.String(), |
| 515 | StatsCollectPeriod: 10, |
| 516 | UseLocalImagePull: useLocalPull, |
| 517 | } |
| 518 | |
| 519 | return images.NewService(cfg, &images.CRIImageServiceOptions{ |
| 520 | ImageFSPaths: map[string]string{ |
| 521 | defaults.DefaultSnapshotter: containerdRootDir, |
| 522 | }, |
| 523 | RuntimePlatforms: map[string]images.ImagePlatform{}, |
| 524 | Content: client.ContentStore(), |
| 525 | Images: client.ImageService(), |
| 526 | Client: client, |
| 527 | Transferrer: client.TransferService(), |
| 528 | }) |
| 529 | } |
no test coverage detected
searching dependent graphs…