()
| 37 | } |
| 38 | |
| 39 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…