Merge pull request #12834 from giuseppe/fix-systemd-session-warning

libpod: fix check for systemd session
This commit is contained in:
OpenShift Merge Robot
2022-01-12 22:50:19 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@ -170,7 +170,6 @@ func NewRuntime(ctx context.Context, options ...RuntimeOption) (*Runtime, error)
if err != nil { if err != nil {
return nil, err return nil, err
} }
conf.CheckCgroupsAndAdjustConfig()
return newRuntimeFromConfig(ctx, conf, options...) return newRuntimeFromConfig(ctx, conf, options...)
} }
@ -228,6 +227,8 @@ func newRuntimeFromConfig(ctx context.Context, conf *config.Config, options ...R
return nil, err return nil, err
} }
runtime.config.CheckCgroupsAndAdjustConfig()
return runtime, nil return runtime, nil
} }

View File

@ -276,4 +276,9 @@ LISTEN_FDNAMES=listen_fdnames" | sort)
is "$output" ".*--template cannot be set" "Error message should be '--template requires --new'" is "$output" ".*--template cannot be set" "Error message should be '--template requires --new'"
} }
@test "podman --cgroup=cgroupfs doesn't show systemd warning" {
DBUS_SESSION_BUS_ADDRESS= run_podman --log-level warning --cgroup-manager=cgroupfs info -f ''
is "$output" "" "output should be empty"
}
# vim: filetype=sh # vim: filetype=sh