Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1359 from AkihiroSuda/shim-v2-runc-v2
Browse files Browse the repository at this point in the history
bump up the default runtime to "io.containerd.runc.v2"
  • Loading branch information
Random-Liu authored Dec 17, 2019
2 parents 61d3e49 + aaddaa2 commit ff8a2e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ version = 2
# of runtime configurations, to the matching configurations.
# In this example, 'runc' is the RuntimeHandler string to match.
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
# runtime_type is the runtime type to use in containerd e.g. io.containerd.runtime.v1.linux
runtime_type = "io.containerd.runc.v1"
# runtime_type is the runtime type to use in containerd.
# The default value is "io.containerd.runc.v2" since containerd 1.4.
# The default value was "io.containerd.runc.v1" in containerd 1.3, "io.containerd.runtime.v1.linux" in prior releases.
runtime_type = "io.containerd.runc.v2"

# pod_annotations is a list of pod annotations passed to both pod
# sandbox as well as container OCI annotations. Pod_annotations also
Expand All @@ -129,8 +131,8 @@ version = 2
privileged_without_host_devices = false

# 'plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options' is options specific to
# "io.containerd.runc.v1". Its corresponding options type is:
# https://github.com/containerd/containerd/blob/v1.2.0-rc.1/runtime/v2/runc/options/oci.pb.go#L39.
# "io.containerd.runc.v1" and "io.containerd.runc.v2". Its corresponding options type is:
# https://github.com/containerd/containerd/blob/v1.3.2/runtime/v2/runc/options/oci.pb.go#L26 .
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
# NoPivotRoot disables pivot root when creating a container.
NoPivotRoot = false
Expand Down Expand Up @@ -159,6 +161,12 @@ version = 2
# SystemdCgroup enables systemd cgroups.
SystemdCgroup = false

# CriuImagePath is the criu image path
CriuImagePath = ""

# CriuWorkPath is the criu work path.
CriuWorkPath = ""

# 'plugins."io.containerd.grpc.v1.cri".cni' contains config related to cni
[plugins."io.containerd.grpc.v1.cri".cni]
# bin_dir is the directory in which the binaries for the plugin is kept.
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func DefaultConfig() PluginConfig {
NoPivot: false,
Runtimes: map[string]Runtime{
"runc": {
Type: "io.containerd.runc.v1",
Type: "io.containerd.runc.v2",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/sandbox_run_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (c *criService) cleanupSandboxFiles(id string, config *runtime.PodSandboxCo
func (c *criService) taskOpts(runtimeType string) []containerd.NewTaskOpts {
// TODO(random-liu): Remove this after shim v1 is deprecated.
var taskOpts []containerd.NewTaskOpts
if c.config.NoPivot && runtimeType == plugin.RuntimeRuncV1 {
if c.config.NoPivot && (runtimeType == plugin.RuntimeRuncV1 || runtimeType == plugin.RuntimeRuncV2) {
taskOpts = append(taskOpts, containerd.WithNoPivotRoot)
}
return taskOpts
Expand Down

0 comments on commit ff8a2e7

Please sign in to comment.