summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-05-30 09:20:04 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-30 09:20:04 -0400
commit57d40939792719e6dc54701226049e2b4c9aadc2 (patch)
tree19bd2a6a4daa1edbdcd71a04ea7cff3a6b484c1a
parent48e35f7da70c24edd339bf29b83c427c48afcaab (diff)
downloadpodman-57d40939792719e6dc54701226049e2b4c9aadc2.tar.gz
podman-57d40939792719e6dc54701226049e2b4c9aadc2.tar.bz2
podman-57d40939792719e6dc54701226049e2b4c9aadc2.zip
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 <matthew.heon@pm.me>
-rw-r--r--cmd/podman/cp.go8
1 files changed, 7 insertions, 1 deletions
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() {