From 23615099e904326ef9e523e0215ac112580db96f Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 28 Feb 2019 09:39:41 +0100 Subject: rootless, new[ug]idmap: on failure add output if any of the mapping tools for setting up the user namespace fail, then include their output in the error message. Signed-off-by: Giuseppe Scrivano --- pkg/rootless/rootless_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index 9a192c0fa..98692707f 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -93,7 +93,8 @@ func tryMappingTool(tool string, pid int, hostID int, mappings []idtools.IDMap) Args: args, } - if err := cmd.Run(); err != nil { + if output, err := cmd.CombinedOutput(); err != nil { + logrus.Debugf("error from %s: %s", tool, output) return errors.Wrapf(err, "cannot setup namespace using %s", tool) } return nil -- cgit v1.2.3-54-g00ecf