diff options
author | Valentin Rothberg <vrothberg@suse.com> | 2018-11-09 09:35:54 +0100 |
---|---|---|
committer | Valentin Rothberg <vrothberg@suse.com> | 2018-11-09 09:41:57 +0100 |
commit | 615df2ecd7ecc4a211d6293c753eea21cf0baab2 (patch) | |
tree | 6ab7f3064ce4b399c704bdd5eefaaeb7dfe7c58d | |
parent | f5473c6cc3ac3418d257fe6aaaf40a5d13fdb281 (diff) | |
download | podman-615df2ecd7ecc4a211d6293c753eea21cf0baab2.tar.gz podman-615df2ecd7ecc4a211d6293c753eea21cf0baab2.tar.bz2 podman-615df2ecd7ecc4a211d6293c753eea21cf0baab2.zip |
info: add rootless field
Add a rootless field to the info data (e.g., `podman info`) to indicate
if the executing user is root or not. In most cases, this can be
guessed but now it is clear and may aid in debugging, reporting and
understanding certain issues.
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
-rw-r--r-- | libpod/info.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libpod/info.go b/libpod/info.go index 4cbf3f734..5d8d160c8 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -12,6 +12,7 @@ import ( "strings" "time" + "github.com/containers/libpod/pkg/rootless" "github.com/containers/libpod/utils" "github.com/containers/storage/pkg/system" "github.com/pkg/errors" @@ -30,6 +31,7 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) { info["os"] = runtime.GOOS info["arch"] = runtime.GOARCH info["cpus"] = runtime.NumCPU() + info["rootless"] = rootless.IsRootless() mi, err := system.ReadMemInfo() if err != nil { return nil, errors.Wrapf(err, "error reading memory info") |