diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-11-07 16:26:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 16:26:22 +0100 |
commit | 24efb5e4ebb6fa96219afeac543d33299b6e1491 (patch) | |
tree | 4782c9e91c8724596208f674569ac755a75191fa /libpod | |
parent | b4a83bf9aebb1aba3b4a5fcceb777f37036f64cb (diff) | |
parent | 709ad91035ecaff05159065126b207dd0f482b55 (diff) | |
download | podman-24efb5e4ebb6fa96219afeac543d33299b6e1491.tar.gz podman-24efb5e4ebb6fa96219afeac543d33299b6e1491.tar.bz2 podman-24efb5e4ebb6fa96219afeac543d33299b6e1491.zip |
Merge pull request #4470 from vrothberg/fix-4463
libpod/config: default: use `crun` on Cgroups v2
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/config/default.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libpod/config/default.go b/libpod/config/default.go index 17574c059..5decaeab7 100644 --- a/libpod/config/default.go +++ b/libpod/config/default.go @@ -6,6 +6,7 @@ import ( "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/events" + "github.com/containers/libpod/pkg/cgroups" "github.com/containers/libpod/pkg/rootless" "github.com/containers/libpod/pkg/util" "github.com/containers/storage" @@ -47,6 +48,12 @@ func defaultConfigFromMemory() (*Config, error) { c.ImageDefaultTransport = _defaultTransport c.StateType = define.BoltDBStateStore 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{ "runc": { "/usr/bin/runc", @@ -58,7 +65,15 @@ func defaultConfigFromMemory() (*Config, error) { "/usr/lib/cri-o-runc/sbin/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{ "/usr/libexec/podman/conmon", |