Merge pull request #5664 from giuseppe/rootless-make-error-not-fatal

rootless: make cgroup ownership detection not fatal
This commit is contained in:
OpenShift Merge Robot
2020-03-30 17:50:06 +02:00
committed by GitHub

View File

@ -174,13 +174,13 @@ func setupRootless(cmd *cobra.Command, args []string) error {
if os.Geteuid() == 0 {
ownsCgroup, err := cgroups.UserOwnsCurrentSystemdCgroup()
if err != nil {
return err
}
conf, err := runtime.GetConfig()
if err != nil {
return err
logrus.Warnf("Failed to detect the owner for the current cgroup: %v", err)
}
if !ownsCgroup {
conf, err := runtime.GetConfig()
if err != nil {
return err
}
unitName := fmt.Sprintf("podman-%d.scope", os.Getpid())
if err := utils.RunUnderSystemdScope(os.Getpid(), "user.slice", unitName); err != nil {
if conf.Engine.CgroupManager == config.SystemdCgroupsManager {