MCPcopy
hub / github.com/containerd/containerd / init

Function init

plugins/snapshots/native/plugin/plugin.go:35–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35func init() {
36 registry.Register(&plugin.Registration{
37 Type: plugins.SnapshotPlugin,
38 ID: "native",
39 Config: &Config{},
40 InitFn: func(ic *plugin.InitContext) (any, error) {
41 ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
42
43 config, ok := ic.Config.(*Config)
44 if !ok {
45 return nil, errors.New("invalid native configuration")
46 }
47
48 root := ic.Properties[plugins.PropertyRootDir]
49 if len(config.RootPath) != 0 {
50 root = config.RootPath
51 }
52
53 ic.Meta.Exports[plugins.SnapshotterRootDir] = root
54 return native.NewSnapshotter(root)
55 },
56 })
57}

Callers

nothing calls this directly

Calls 2

NewSnapshotterFunction · 0.92
RegisterMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…