Skip to content

Commit

Permalink
help message: don't parse the config for cgroup-manager default
Browse files Browse the repository at this point in the history
Do not generate an entire `config.Config` for displaying the default
value for the --cgroup-manager flag and just default to systemd. Not
using the `config.Config` is okay as 1) the value may change at runtime
in any case (rootless, DBUS access, etc.), 2) it avoids to redundantly
parse the system config files and to generate the hard-coded default
config, and 3) the log-level and other attributes are not yet set during
init() causing undesirable side effects.

Fixes: containers#4456
Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Nov 6, 2019
1 parent b4b7272 commit eb9235f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cmd/podman/main_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/cmd/podman/libpodruntime"
"github.com/containers/libpod/libpod/config"
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/pkg/cgroups"
"github.com/containers/libpod/pkg/rootless"
Expand All @@ -34,9 +33,6 @@ const remote = false

func init() {
cgroupManager := define.SystemdCgroupsManager
if runtimeConfig, err := config.NewConfig(""); err == nil {
cgroupManager = runtimeConfig.CgroupManager
}
cgroupHelp := "Cgroup manager to use (cgroupfs or systemd)"
cgroupv2, _ := cgroups.IsCgroup2UnifiedMode()
if rootless.IsRootless() && !cgroupv2 {
Expand Down

0 comments on commit eb9235f

Please sign in to comment.