MCPcopy Index your code
hub / github.com/containerd/containerd / initLocalCRIImageService

Function initLocalCRIImageService

integration/image_pull_timeout_test.go:508–529  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

506// NOTE: We don't need to start the CRI plugin here because we just need the
507// ImageService API.
508func 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}

Calls 5

NewServiceFunction · 0.92
TransferServiceMethod · 0.80
ContentStoreMethod · 0.65
ImageServiceMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…