aboutsummaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-08 11:00:52 -0800
committerGitHub <noreply@github.com>2019-03-08 11:00:52 -0800
commitbf8c2096d8bba5d94a6e6201ba483f2aa72f1d01 (patch)
tree4789ab531f7259212be9337a4f516d6072c870fd /libpod/runtime.go
parent5ae7359184a20859d775bc59f1b1c53348b04ecd (diff)
parentcc411dd98fed42a19d2d4f8ec1922ba62da49957 (diff)
downloadpodman-bf8c2096d8bba5d94a6e6201ba483f2aa72f1d01.tar.gz
podman-bf8c2096d8bba5d94a6e6201ba483f2aa72f1d01.tar.bz2
podman-bf8c2096d8bba5d94a6e6201ba483f2aa72f1d01.zip
Merge pull request #2588 from giuseppe/rootless-propagate-error-from-info
rootless: propagate errors from info
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 482cd9d73..9667abfe6 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -971,9 +971,12 @@ func (r *Runtime) refreshRootless() error {
// Take advantage of a command that requires a new userns
// so that we are running as the root user and able to use refresh()
cmd := exec.Command(os.Args[0], "info")
- err := cmd.Run()
- if err != nil {
- return errors.Wrapf(err, "Error running %s info while refreshing state", os.Args[0])
+
+ if output, err := cmd.CombinedOutput(); err != nil {
+ if _, ok := err.(*exec.ExitError); !ok {
+ return errors.Wrapf(err, "Error waiting for info while refreshing state: %s", os.Args[0])
+ }
+ return errors.Wrapf(err, "Error running %s info while refreshing state: %s", os.Args[0], output)
}
return nil
}