summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-10 15:11:10 -0700
committerGitHub <noreply@github.com>2019-10-10 15:11:10 -0700
commit6d35eac6a35bb3343314dd27cb4c921fb44bba19 (patch)
treea90a2ce380dd9654e342d83c1fedf9a27fa2a26e /libpod
parentfd389d28ce2223550c82d809cbafa12a54e733e6 (diff)
parent3fff42e0ab570c3b3c0823210dd6c6e16325cbbc (diff)
downloadpodman-6d35eac6a35bb3343314dd27cb4c921fb44bba19.tar.gz
podman-6d35eac6a35bb3343314dd27cb4c921fb44bba19.tar.bz2
podman-6d35eac6a35bb3343314dd27cb4c921fb44bba19.zip
Merge pull request #4223 from QiWang19/uidmap
show uid_map in podman info
Diffstat (limited to 'libpod')
-rw-r--r--libpod/info.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/info.go b/libpod/info.go
index 297086ebb..6caa87038 100644
--- a/libpod/info.go
+++ b/libpod/info.go
@@ -69,6 +69,18 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
program["Package"] = packageVersion(path)
info["slirp4netns"] = program
}
+ uidmappings, err := rootless.ReadMappingsProc("/proc/self/uid_map")
+ if err != nil {
+ return nil, errors.Wrapf(err, "error reading uid mappings")
+ }
+ gidmappings, err := rootless.ReadMappingsProc("/proc/self/gid_map")
+ if err != nil {
+ return nil, errors.Wrapf(err, "error reading gid mappings")
+ }
+ idmappings := make(map[string]interface{})
+ idmappings["uidmap"] = uidmappings
+ idmappings["gidmap"] = gidmappings
+ info["IDMappings"] = idmappings
}
info["OCIRuntime"] = map[string]interface{}{
"path": r.defaultOCIRuntime.path,
@@ -128,6 +140,7 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
}
info["hostname"] = host
info["eventlogger"] = r.eventer.String()
+
return info, nil
}