Add configuration for specifying cgroup manager
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
parent
a7190853b6
commit
edad8f866d
3 changed files with 17 additions and 0 deletions
|
@ -16,6 +16,7 @@ const (
|
||||||
pausePath = "/usr/libexec/ocid/pause"
|
pausePath = "/usr/libexec/ocid/pause"
|
||||||
seccompProfilePath = "/etc/ocid/seccomp.json"
|
seccompProfilePath = "/etc/ocid/seccomp.json"
|
||||||
apparmorProfileName = "ocid-default"
|
apparmorProfileName = "ocid-default"
|
||||||
|
cgroupManager = "cgroupfs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var commentedConfigTemplate = template.Must(template.New("config").Parse(`
|
var commentedConfigTemplate = template.Must(template.New("config").Parse(`
|
||||||
|
@ -69,6 +70,10 @@ seccomp_profile = "{{ .SeccompProfile }}"
|
||||||
# default for the runtime.
|
# default for the runtime.
|
||||||
apparmor_profile = "{{ .ApparmorProfile }}"
|
apparmor_profile = "{{ .ApparmorProfile }}"
|
||||||
|
|
||||||
|
# cgroup_manager is the cgroup management implementation to be used
|
||||||
|
# for the runtime.
|
||||||
|
cgroup_manager = "{{ .CgroupManager }}"
|
||||||
|
|
||||||
# The "ocid.image" table contains settings pertaining to the
|
# The "ocid.image" table contains settings pertaining to the
|
||||||
# management of OCI images.
|
# management of OCI images.
|
||||||
[ocid.image]
|
[ocid.image]
|
||||||
|
@ -102,6 +107,7 @@ func DefaultConfig() *server.Config {
|
||||||
SELinux: selinux.SelinuxEnabled(),
|
SELinux: selinux.SelinuxEnabled(),
|
||||||
SeccompProfile: seccompProfilePath,
|
SeccompProfile: seccompProfilePath,
|
||||||
ApparmorProfile: apparmorProfileName,
|
ApparmorProfile: apparmorProfileName,
|
||||||
|
CgroupManager: cgroupManager,
|
||||||
},
|
},
|
||||||
ImageConfig: server.ImageConfig{
|
ImageConfig: server.ImageConfig{
|
||||||
Pause: pausePath,
|
Pause: pausePath,
|
||||||
|
|
|
@ -63,6 +63,9 @@ func mergeConfig(config *server.Config, ctx *cli.Context) error {
|
||||||
if ctx.GlobalIsSet("apparmor-profile") {
|
if ctx.GlobalIsSet("apparmor-profile") {
|
||||||
config.ApparmorProfile = ctx.GlobalString("apparmor-profile")
|
config.ApparmorProfile = ctx.GlobalString("apparmor-profile")
|
||||||
}
|
}
|
||||||
|
if ctx.GlobalIsSet("cgroup-manager") {
|
||||||
|
config.CgroupManager = ctx.GlobalString("cgroup-manager")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +153,10 @@ func main() {
|
||||||
Name: "selinux",
|
Name: "selinux",
|
||||||
Usage: "enable selinux support",
|
Usage: "enable selinux support",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "cgroup-manager",
|
||||||
|
Usage: "cgroup manager (cgroupfs or systemd)",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove once https://github.com/urfave/cli/pull/544 lands
|
// remove once https://github.com/urfave/cli/pull/544 lands
|
||||||
|
|
|
@ -72,6 +72,10 @@ type RuntimeConfig struct {
|
||||||
// ApparmorProfile is the apparmor profile name which is used as the
|
// ApparmorProfile is the apparmor profile name which is used as the
|
||||||
// default for the runtime.
|
// default for the runtime.
|
||||||
ApparmorProfile string `toml:"apparmor_profile"`
|
ApparmorProfile string `toml:"apparmor_profile"`
|
||||||
|
|
||||||
|
// CgroupManager is the manager implementation name which is used to
|
||||||
|
// handle cgroups for containers.
|
||||||
|
CgroupManager string `toml:"cgroup_manager"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageConfig represents the "ocid.image" TOML config table.
|
// ImageConfig represents the "ocid.image" TOML config table.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue