Merge pull request #5302 from mikebrow/toml-cri-defaults

shows our runc.v2 default options
This commit is contained in:
Fu, Wei 2021-04-09 11:11:25 +08:00 committed by GitHub
commit d064140369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,10 +21,46 @@ package config
import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/pkg/cri/streaming"
"github.com/pelletier/go-toml"
)
// DefaultConfig returns default configurations of cri plugin.
func DefaultConfig() PluginConfig {
defaultRuncV2Opts := `
# NoPivotRoot disables pivot root when creating a container.
NoPivotRoot = false
# NoNewKeyring disables new keyring for the container.
NoNewKeyring = false
# ShimCgroup places the shim in a cgroup.
ShimCgroup = ""
# IoUid sets the I/O's pipes uid.
IoUid = 0
# IoGid sets the I/O's pipes gid.
IoGid = 0
# BinaryName is the binary name of the runc binary.
BinaryName = ""
# Root is the runc root directory.
Root = ""
# CriuPath is the criu binary path.
CriuPath = ""
# SystemdCgroup enables systemd cgroups.
SystemdCgroup = false
# CriuImagePath is the criu image path
CriuImagePath = ""
# CriuWorkPath is the criu work path.
CriuWorkPath = ""
`
tree, _ := toml.Load(defaultRuncV2Opts)
return PluginConfig{
CniConfig: CniConfig{
NetworkPluginBinDir: "/opt/cni/bin",
@ -39,6 +75,7 @@ func DefaultConfig() PluginConfig {
Runtimes: map[string]Runtime{
"runc": {
Type: "io.containerd.runc.v2",
Options: tree.ToMap(),
},
},
DisableSnapshotAnnotations: true,