From 57d40939792719e6dc54701226049e2b4c9aadc2 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 30 May 2019 09:20:04 -0400 Subject: Error when trying to copy into a running rootless ctr We can't pause them, so if that's requested, throw an error. Signed-off-by: Matthew Heon --- cmd/podman/cp.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go index 406337955..907bde4b9 100644 --- a/cmd/podman/cp.go +++ b/cmd/podman/cp.go @@ -98,7 +98,13 @@ func copyBetweenHostAndContainer(runtime *libpod.Runtime, src string, dest strin // We can't pause rootless containers. if pause && rootless.IsRootless() { - logrus.Warnf("Cannot pause rootless containers - pause option will be ignored") + state, err := ctr.State() + if err != nil { + return err + } + if state == libpod.ContainerStateRunning { + return errors.Errorf("cannot copy into running rootless container with pause set - pass --pause=false to force copying") + } } if pause && !rootless.IsRootless() { -- cgit v1.2.3-54-g00ecf