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

Function init

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

Source from the content-addressed store, hash-verified

30)
31
32func init() {
33 registry.Register(&plugin.Registration{
34 Type: plugins.SnapshotPlugin,
35 ID: "devmapper",
36 Config: &devmapper.Config{},
37 InitFn: func(ic *plugin.InitContext) (any, error) {
38 ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
39
40 config, ok := ic.Config.(*devmapper.Config)
41 if !ok {
42 return nil, errors.New("invalid devmapper configuration")
43 }
44
45 if config.PoolName == "" {
46 return nil, fmt.Errorf("devmapper not configured: %w", plugin.ErrSkipPlugin)
47 }
48
49 if config.RootPath == "" {
50 config.RootPath = ic.Properties[plugins.PropertyRootDir]
51 }
52
53 ic.Meta.Exports[plugins.SnapshotterRootDir] = config.RootPath
54 return devmapper.NewSnapshotter(ic.Context, config)
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…