Vendor in latest containers/psgo code

This fixes a couple of issues with podman top.

podman top --latest USER HUSER

Now shows you the User inside of the containers usernamespace as well as the user on the host.

podman top --latest capeff capbnd

Now has headings that differentiatiate between the Capabiltiies.  We also have support for
ambient capabilities.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1286
Approved by: vrothberg
This commit is contained in:
Daniel J Walsh
2018-08-16 12:10:23 -04:00
committed by Atomic Bot
parent d20f3a5146
commit 37e3f47ef3
7 changed files with 108 additions and 23 deletions

View File

@ -13,3 +13,12 @@ func ParsePIDNamespace(pid string) (string, error) {
}
return pidNS, nil
}
// ParseUserNamespace returns the content of /proc/$pid/ns/user.
func ParseUserNamespace(pid string) (string, error) {
userNS, err := os.Readlink(fmt.Sprintf("/proc/%s/ns/user", pid))
if err != nil {
return "", err
}
return userNS, nil
}