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

Function init

plugins/snapshots/btrfs/plugin/plugin.go:39–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

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…