From 354dab0caa57e27889d8580c98d5ada14d44d3b7 Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Thu, 1 Nov 2018 14:25:18 -0700 Subject: [PATCH] Forward ctr.exe --debug as io.containerd.runhcs.v1 options Signed-off-by: Justin Terry (VM) --- cmd/ctr/commands/run/run_windows.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/ctr/commands/run/run_windows.go b/cmd/ctr/commands/run/run_windows.go index ea297aac2..1e2b99a2e 100644 --- a/cmd/ctr/commands/run/run_windows.go +++ b/cmd/ctr/commands/run/run_windows.go @@ -23,6 +23,7 @@ import ( "github.com/containerd/containerd" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/oci" + "github.com/containerd/containerd/runtime/v2/runhcs/options" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" "github.com/urfave/cli" @@ -100,7 +101,14 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli } cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("label")))) - cOpts = append(cOpts, containerd.WithRuntime(context.String("runtime"), nil)) + runtime := context.String("runtime") + var runtimeOpts interface{} + if runtime == "io.containerd.runhcs.v1" { + runtimeOpts = &options.Options{ + Debug: context.GlobalBool("debug"), + } + } + cOpts = append(cOpts, containerd.WithRuntime(runtime, runtimeOpts)) var s specs.Spec spec = containerd.WithSpec(&s, opts...)