summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-01-10 11:23:42 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-01-10 11:23:45 +0100
commit751c403d8b74d3e9211c59ee01872e1e2f45b258 (patch)
tree70ec2bd4187a1a36d21355caf16e0e67e3adfc5d
parentf3fc10feb42930def6922fc050096ea38bafed7a (diff)
downloadpodman-751c403d8b74d3e9211c59ee01872e1e2f45b258.tar.gz
podman-751c403d8b74d3e9211c59ee01872e1e2f45b258.tar.bz2
podman-751c403d8b74d3e9211c59ee01872e1e2f45b258.zip
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 <gscrivan@redhat.com>
-rw-r--r--cmd/podman/cp.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go
index 1e4491f33..ea97752a3 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.