Skip to content

Commit 116902c

Browse files
author
zhangjianming
committed
fix no-pivot not working in io.containerd.runtime.v1.linux
Signed-off-by: zhangjianming <[email protected]>
1 parent 98a7355 commit 116902c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/cri/server/sandbox_run_linux.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,14 @@ func (c *criService) cleanupSandboxFiles(id string, config *runtime.PodSandboxCo
301301
func (c *criService) taskOpts(runtimeType string) []containerd.NewTaskOpts {
302302
// TODO(random-liu): Remove this after shim v1 is deprecated.
303303
var taskOpts []containerd.NewTaskOpts
304-
if c.config.NoPivot && (runtimeType == plugin.RuntimeRuncV1 || runtimeType == plugin.RuntimeRuncV2) {
304+
305+
// c.config.NoPivot is only supported for RuntimeLinuxV1 = "io.containerd.runtime.v1.linux" legacy linux runtime
306+
// and is not supported for RuntimeRuncV1 = "io.containerd.runc.v1" or RuntimeRuncV2 = "io.containerd.runc.v2"
307+
// for RuncV1/2 no pivot is set under the containerd.runtimes.runc.options config see
308+
// https://github.com/containerd/containerd/blob/v1.3.2/runtime/v2/runc/options/oci.pb.go#L26
309+
if c.config.NoPivot && runtimeType == plugin.RuntimeLinuxV1 {
305310
taskOpts = append(taskOpts, containerd.WithNoPivotRoot)
306311
}
312+
307313
return taskOpts
308314
}

0 commit comments

Comments
 (0)