Use typeurl package for spec types

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-07-05 15:11:59 -07:00
parent f8720382b3
commit a60511d5aa
22 changed files with 163 additions and 264 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/containerd/console"
shim "github.com/containerd/containerd/linux/shim/v1"
"github.com/containerd/containerd/typeurl"
protobuf "github.com/gogo/protobuf/types"
google_protobuf "github.com/golang/protobuf/ptypes/empty"
"github.com/opencontainers/runtime-spec/specs-go"
@@ -235,10 +236,14 @@ var shimExecCommand = cli.Command{
if err != nil {
return err
}
url, err := typeurl.TypeUrl(specs.Process{})
if err != nil {
return err
}
rq := &shim.ExecProcessRequest{
Spec: &protobuf.Any{
TypeUrl: specs.Version,
TypeUrl: url,
Value: spec,
},
Stdin: context.String("stdin"),