Skip to content

Commit 9144ce9

Browse files
committed
shows our runc.v2 default options in the containerd default config
Signed-off-by: Mike Brown <[email protected]>
1 parent ceb0875 commit 9144ce9

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

pkg/cri/config/config_unix.go

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,46 @@ package config
2121
import (
2222
"github.com/containerd/containerd"
2323
"github.com/containerd/containerd/pkg/cri/streaming"
24+
"github.com/pelletier/go-toml"
2425
)
2526

2627
// DefaultConfig returns default configurations of cri plugin.
2728
func DefaultConfig() PluginConfig {
29+
defaultRuncV2Opts := `
30+
# NoPivotRoot disables pivot root when creating a container.
31+
NoPivotRoot = false
32+
33+
# NoNewKeyring disables new keyring for the container.
34+
NoNewKeyring = false
35+
36+
# ShimCgroup places the shim in a cgroup.
37+
ShimCgroup = ""
38+
39+
# IoUid sets the I/O's pipes uid.
40+
IoUid = 0
41+
42+
# IoGid sets the I/O's pipes gid.
43+
IoGid = 0
44+
45+
# BinaryName is the binary name of the runc binary.
46+
BinaryName = ""
47+
48+
# Root is the runc root directory.
49+
Root = ""
50+
51+
# CriuPath is the criu binary path.
52+
CriuPath = ""
53+
54+
# SystemdCgroup enables systemd cgroups.
55+
SystemdCgroup = false
56+
57+
# CriuImagePath is the criu image path
58+
CriuImagePath = ""
59+
60+
# CriuWorkPath is the criu work path.
61+
CriuWorkPath = ""
62+
`
63+
tree, _ := toml.Load(defaultRuncV2Opts)
2864
return PluginConfig{
2965
CniConfig: CniConfig{
3066
NetworkPluginBinDir: "/opt/cni/bin",
@@ -38,7 +74,8 @@ func DefaultConfig() PluginConfig {
3874
NoPivot: false,
3975
Runtimes: map[string]Runtime{
4076
"runc": {
41-
Type: "io.containerd.runc.v2",
77+
Type: "io.containerd.runc.v2",
78+
Options: tree,
4279
},
4380
},
4481
DisableSnapshotAnnotations: true,

0 commit comments

Comments
 (0)