Merge pull request #382 from runcom/not-only-runc

cmd/containerd: extend to other OCI runtimes
This commit is contained in:
Michael Crosby 2017-01-10 09:26:21 -08:00 committed by GitHub
commit 4c848c4654
1 changed files with 8 additions and 3 deletions

View File

@ -55,7 +55,7 @@ high performance container runtime
},
cli.StringFlag{
Name: "runtime",
Usage: "default runtime for execution",
Usage: "runtime for execution",
Value: "runc",
},
cli.StringFlag{
@ -103,13 +103,18 @@ high performance container runtime
return err
}
var executor execution.Executor
switch context.GlobalString("runtime") {
var (
executor execution.Executor
runtime = context.GlobalString("runtime")
)
switch runtime {
case "runc":
executor, err = oci.New(context.GlobalString("root"))
if err != nil {
return err
}
default:
return fmt.Errorf("oci: runtime %q not implemented", runtime)
}
// Get events publisher