From 98b39002baab3a3dbf78fc47377de557b95e0858 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Fri, 16 Dec 2016 18:35:04 +0100 Subject: [PATCH] cmd/containerd: extend to other OCI runtimes Signed-off-by: Antonio Murdaca --- cmd/containerd/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/containerd/main.go b/cmd/containerd/main.go index 3e2b2fb..fbe9507 100644 --- a/cmd/containerd/main.go +++ b/cmd/containerd/main.go @@ -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