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