From eee0f4f7f85d973c720702929447fefddace5bbf Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Mon, 9 Mar 2020 15:17:34 -0400 Subject: [PATCH] remove CgroupsAndAdjust from NewConfig Export CheckCgroupsAndAdjustConfig() as global function and remove it from NewConfig(). So we can handle it in libpod and avoid Buildah to display cgroup warning message when reading containers.conf. Signed-off-by: Qi Wang --- common/pkg/config/config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/pkg/config/config.go b/common/pkg/config/config.go index 113f2d2971..a9f8a51e23 100644 --- a/common/pkg/config/config.go +++ b/common/pkg/config/config.go @@ -422,7 +422,6 @@ func NewConfig(userConfigPath string) (*Config, error) { logrus.Debugf("Merged system config %q: %v", path, config) } - config.checkCgroupsAndAdjustConfig() config.addCAPPrefix() if err := config.Validate(); err != nil { @@ -485,10 +484,10 @@ func systemConfigs() ([]string, error) { return configs, nil } -// checkCgroupsAndAdjustConfig checks if we're running rootless with the systemd +// CheckCgroupsAndAdjustConfig checks if we're running rootless with the systemd // cgroup manager. In case the user session isn't available, we're switching the // cgroup manager to cgroupfs. Note, this only applies to rootless. -func (c *Config) checkCgroupsAndAdjustConfig() { +func (c *Config) CheckCgroupsAndAdjustConfig() { if !unshare.IsRootless() || c.Libpod.CgroupManager != SystemdCgroupsManager { return }