cmd/containerd: extend to other OCI runtimes

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-12-16 18:35:04 +01:00
parent 58640c9603
commit 98b39002ba
No known key found for this signature in database
GPG Key ID: B2BEAD150DE936B9
1 changed files with 8 additions and 3 deletions

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