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>
This commit is contained in:
Matthew Heon
2019-05-30 09:20:04 -04:00
parent 48e35f7da7
commit 57d4093979

View File

@ -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() {