Merge pull request #80 from QiWang19/rm_cgroup_check

remove CgroupsAndAdjust from NewConfig
This commit is contained in:
Daniel J Walsh 2020-03-09 16:59:22 -04:00 committed by GitHub
commit 66647dd5c2
1 changed files with 2 additions and 3 deletions

View File

@ -422,7 +422,6 @@ func NewConfig(userConfigPath string) (*Config, error) {
logrus.Debugf("Merged system config %q: %v", path, config) logrus.Debugf("Merged system config %q: %v", path, config)
} }
config.checkCgroupsAndAdjustConfig()
config.addCAPPrefix() config.addCAPPrefix()
if err := config.Validate(); err != nil { if err := config.Validate(); err != nil {
@ -485,10 +484,10 @@ func systemConfigs() ([]string, error) {
return configs, nil 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. In case the user session isn't available, we're switching the
// cgroup manager to cgroupfs. Note, this only applies to rootless. // 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 { if !unshare.IsRootless() || c.Libpod.CgroupManager != SystemdCgroupsManager {
return return
} }