Move plugin registration to separate package

Only compile in plugin support on non-windows 1.8.
Re-enable go 1.7.x tests.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2017-03-06 17:23:00 -08:00
parent a7cb5a783c
commit 0b44e24c07
8 changed files with 81 additions and 61 deletions

View file

@ -14,6 +14,7 @@ import (
"github.com/docker/containerd/api/types/container"
"github.com/docker/containerd/api/types/mount"
"github.com/docker/containerd/log"
"github.com/docker/containerd/plugin"
"golang.org/x/net/context"
)
@ -24,13 +25,13 @@ const (
)
func init() {
containerd.Register(runtimeName, &containerd.Registration{
Type: containerd.RuntimePlugin,
plugin.Register(runtimeName, &plugin.Registration{
Type: plugin.RuntimePlugin,
Init: New,
})
}
func New(ic *containerd.InitContext) (interface{}, error) {
func New(ic *plugin.InitContext) (interface{}, error) {
path := filepath.Join(ic.State, runtimeName)
if err := os.MkdirAll(path, 0700); err != nil {
return nil, err