Move plugin type definitions to containerd plugins package
The plugins packages defines the plugins used by containerd. Move all the types and properties to this package. Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/gc"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/plugins"
|
||||
"github.com/containerd/log"
|
||||
)
|
||||
|
||||
@@ -97,10 +98,10 @@ func (d duration) MarshalText() (text []byte, err error) {
|
||||
|
||||
func init() {
|
||||
plugin.Register(&plugin.Registration{
|
||||
Type: plugin.GCPlugin,
|
||||
Type: plugins.GCPlugin,
|
||||
ID: "scheduler",
|
||||
Requires: []plugin.Type{
|
||||
plugin.MetadataPlugin,
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
Config: &config{
|
||||
PauseThreshold: 0.02,
|
||||
@@ -110,14 +111,14 @@ func init() {
|
||||
StartupDelay: duration(100 * time.Millisecond),
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
md, err := ic.Get(plugin.MetadataPlugin)
|
||||
md, err := ic.Get(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mdCollector, ok := md.(collector)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("%s %T must implement collector", plugin.MetadataPlugin, md)
|
||||
return nil, fmt.Errorf("%s %T must implement collector", plugins.MetadataPlugin, md)
|
||||
}
|
||||
|
||||
m := newScheduler(mdCollector, ic.Config.(*config))
|
||||
|
||||
Reference in New Issue
Block a user