Skip to content

Commit a1dfb02

Browse files
committed
Fix the --runtime option of container create is ignored
Signed-off-by: Kay Yan <[email protected]>
1 parent 9cd00de commit a1dfb02

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/nerdctl/compose_up_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ services:
4646
c := base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d")
4747
expected := icmd.Expected{
4848
ExitCode: 1,
49-
Err: `exec: \"invalid\": executable file not found in $PATH`,
49+
Err: `failed to resolve runtime path: invalid runtime name invalid`,
5050
}
5151
if base.Target == testutil.Docker {
52-
expected.Err = `Unknown runtime specified invalid`
52+
expected.Err = `unknown or invalid runtime name: invalid`
5353
}
5454
c.Assert(expected)
5555
}

pkg/cmd/container/run_runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func generateRuntimeCOpts(cgroupManager, runtimeStr string) ([]containerd.NewCon
3939
runcOpts.SystemdCgroup = true
4040
}
4141
if runtimeStr != "" {
42+
runtime = runtimeStr
4243
if strings.HasPrefix(runtimeStr, "io.containerd.") || runtimeStr == "wtf.sbk.runj.v1" {
43-
runtime = runtimeStr
4444
if !strings.HasPrefix(runtimeStr, "io.containerd.runc.") {
4545
if cgroupManager == "systemd" {
4646
logrus.Warnf("cannot set cgroup manager to %q for runtime %q", cgroupManager, runtimeStr)

0 commit comments

Comments
 (0)