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

@ -7,6 +7,7 @@ import (
api "github.com/docker/containerd/api/services/execution"
"github.com/docker/containerd/api/types/container"
"github.com/docker/containerd/log"
"github.com/docker/containerd/plugin"
google_protobuf "github.com/golang/protobuf/ptypes/empty"
"golang.org/x/net/context"
"google.golang.org/grpc"
@ -18,13 +19,13 @@ var (
)
func init() {
containerd.Register("runtime-grpc", &containerd.Registration{
Type: containerd.GRPCPlugin,
plugin.Register("runtime-grpc", &plugin.Registration{
Type: plugin.GRPCPlugin,
Init: New,
})
}
func New(ic *containerd.InitContext) (interface{}, error) {
func New(ic *plugin.InitContext) (interface{}, error) {
c, err := newCollector(ic.Context, ic.Runtimes)
if err != nil {
return nil, err