From 751c403d8b74d3e9211c59ee01872e1e2f45b258 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 10 Jan 2020 11:23:42 +0100 Subject: [PATCH] cp: drop check for rootless rootless containers can use pause on cgroups v2. Whether it is possible or not to use pause depends from multiple conditions, such as: - be on a cgroup v2 unified hierarchy, - using systemd cgroup manager, - the kernel has the freezer controller, The last one may fail for root as well. Instead of trying to catch all the possible conditions in Podman, let the OCI runtime complain if pause cannot be performed. Closes: https://github.com/containers/libpod/issues/4813 Signed-off-by: Giuseppe Scrivano --- cmd/podman/cp.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go index 1e4491f33da3..ea97752a3f2a 100644 --- a/cmd/podman/cp.go +++ b/cmd/podman/cp.go @@ -101,18 +101,7 @@ func copyBetweenHostAndContainer(runtime *libpod.Runtime, src string, dest strin } }() - // We can't pause rootless containers. - if pause && rootless.IsRootless() { - state, err := ctr.State() - if err != nil { - return err - } - if state == define.ContainerStateRunning { - return errors.Errorf("cannot copy into running rootless container with pause set - pass --pause=false to force copying") - } - } - - if pause && !rootless.IsRootless() { + if pause { if err := ctr.Pause(); err != nil { // An invalid state error is fine. // The container isn't running or is already paused.