mirror of
https://github.com/containers/podman.git
synced 2025-06-22 01:48:54 +08:00
Merge pull request #4470 from vrothberg/fix-4463
libpod/config: default: use `crun` on Cgroups v2
This commit is contained in:
@ -142,8 +142,13 @@ runc = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
crun = [
|
crun = [
|
||||||
"/usr/bin/crun",
|
"/usr/bin/crun",
|
||||||
"/usr/local/bin/crun",
|
"/usr/sbin/crun",
|
||||||
|
"/usr/local/bin/crun",
|
||||||
|
"/usr/local/sbin/crun",
|
||||||
|
"/sbin/crun",
|
||||||
|
"/bin/crun",
|
||||||
|
"/run/current-system/sw/bin/crun",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Kata Containers is an OCI runtime, where containers are run inside lightweight
|
# Kata Containers is an OCI runtime, where containers are run inside lightweight
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/containers/libpod/libpod/define"
|
"github.com/containers/libpod/libpod/define"
|
||||||
"github.com/containers/libpod/libpod/events"
|
"github.com/containers/libpod/libpod/events"
|
||||||
|
"github.com/containers/libpod/pkg/cgroups"
|
||||||
"github.com/containers/libpod/pkg/rootless"
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
"github.com/containers/libpod/pkg/util"
|
"github.com/containers/libpod/pkg/util"
|
||||||
"github.com/containers/storage"
|
"github.com/containers/storage"
|
||||||
@ -47,6 +48,12 @@ func defaultConfigFromMemory() (*Config, error) {
|
|||||||
c.ImageDefaultTransport = _defaultTransport
|
c.ImageDefaultTransport = _defaultTransport
|
||||||
c.StateType = define.BoltDBStateStore
|
c.StateType = define.BoltDBStateStore
|
||||||
c.OCIRuntime = "runc"
|
c.OCIRuntime = "runc"
|
||||||
|
|
||||||
|
// If we're running on cgroups v2, default to using crun.
|
||||||
|
if onCgroupsv2, _ := cgroups.IsCgroup2UnifiedMode(); onCgroupsv2 {
|
||||||
|
c.OCIRuntime = "crun"
|
||||||
|
}
|
||||||
|
|
||||||
c.OCIRuntimes = map[string][]string{
|
c.OCIRuntimes = map[string][]string{
|
||||||
"runc": {
|
"runc": {
|
||||||
"/usr/bin/runc",
|
"/usr/bin/runc",
|
||||||
@ -58,7 +65,15 @@ func defaultConfigFromMemory() (*Config, error) {
|
|||||||
"/usr/lib/cri-o-runc/sbin/runc",
|
"/usr/lib/cri-o-runc/sbin/runc",
|
||||||
"/run/current-system/sw/bin/runc",
|
"/run/current-system/sw/bin/runc",
|
||||||
},
|
},
|
||||||
// TODO - should we add "crun" defaults here as well?
|
"crun": {
|
||||||
|
"/usr/bin/crun",
|
||||||
|
"/usr/sbin/crun",
|
||||||
|
"/usr/local/bin/crun",
|
||||||
|
"/usr/local/sbin/crun",
|
||||||
|
"/sbin/crun",
|
||||||
|
"/bin/crun",
|
||||||
|
"/run/current-system/sw/bin/crun",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
c.ConmonPath = []string{
|
c.ConmonPath = []string{
|
||||||
"/usr/libexec/podman/conmon",
|
"/usr/libexec/podman/conmon",
|
||||||
|
Reference in New Issue
Block a user