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

Function init

plugins/diff/walking/plugin/plugin.go:33–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31)
32
33func init() {
34 registry.Register(&plugin.Registration{
35 Type: plugins.DiffPlugin,
36 ID: "walking",
37 Requires: []plugin.Type{
38 plugins.MetadataPlugin,
39 plugins.MountManagerPlugin,
40 },
41 InitFn: func(ic *plugin.InitContext) (any, error) {
42 md, err := ic.GetSingle(plugins.MetadataPlugin)
43 if err != nil {
44 return nil, err
45 }
46
47 var mm mount.Manager
48 if mountsI, err := ic.GetSingle(plugins.MountManagerPlugin); err == nil {
49 mm = mountsI.(mount.Manager)
50 } else if !errors.Is(err, plugin.ErrPluginNotFound) {
51 return nil, err
52 }
53
54 ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
55 cs := md.(*metadata.DB).ContentStore()
56
57 return diffPlugin{
58 Comparer: walking.NewWalkingDiff(cs),
59 Applier: apply.NewFileSystemApplierWithMountManager(cs, mm),
60 }, nil
61 },
62 })
63}
64
65type diffPlugin struct {
66 diff.Comparer

Callers

nothing calls this directly

Calls 4

NewWalkingDiffFunction · 0.92
RegisterMethod · 0.65
ContentStoreMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…