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

View file

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