Skip to content

Commit 6a8198b

Browse files
jterry75thaJeztah
authored andcommitted
Forward ctr.exe --debug as io.containerd.runhcs.v1 options
Signed-off-by: Justin Terry (VM) <[email protected]> (cherry picked from commit 354dab0) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent d40cc95 commit 6a8198b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/ctr/commands/run/run_windows.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/containerd/containerd"
2424
"github.com/containerd/containerd/cmd/ctr/commands"
2525
"github.com/containerd/containerd/oci"
26+
"github.com/containerd/containerd/runtime/v2/runhcs/options"
2627
specs "github.com/opencontainers/runtime-spec/specs-go"
2728
"github.com/sirupsen/logrus"
2829
"github.com/urfave/cli"
@@ -100,7 +101,14 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
100101
}
101102

102103
cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("label"))))
103-
cOpts = append(cOpts, containerd.WithRuntime(context.String("runtime"), nil))
104+
runtime := context.String("runtime")
105+
var runtimeOpts interface{}
106+
if runtime == "io.containerd.runhcs.v1" {
107+
runtimeOpts = &options.Options{
108+
Debug: context.GlobalBool("debug"),
109+
}
110+
}
111+
cOpts = append(cOpts, containerd.WithRuntime(runtime, runtimeOpts))
104112

105113
var s specs.Spec
106114
spec = containerd.WithSpec(&s, opts...)

0 commit comments

Comments
 (0)