diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2019-08-31 07:19:39 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2019-09-06 07:32:42 -0400 |
commit | b2b284111e49d3d953f71a794f25aa9ddfbb8568 (patch) | |
tree | 280582a73cb3c3cc080517c5fdaafbbf90846fe0 /libpod/info.go | |
parent | a4572c4f681ef23495495f313ae513d5ba3fd495 (diff) | |
download | podman-b2b284111e49d3d953f71a794f25aa9ddfbb8568.tar.gz podman-b2b284111e49d3d953f71a794f25aa9ddfbb8568.tar.bz2 podman-b2b284111e49d3d953f71a794f25aa9ddfbb8568.zip |
Return information about mount_program (fuse-overlayfs)
We want to get podman info to tell us about the version of
the mount program to help us diagnose issues users are having.
Also if in rootless mode and slirp4netns is installed reveal package
info on slirp4netns.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/info.go')
-rw-r--r-- | libpod/info.go | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/libpod/info.go b/libpod/info.go index 9ab6f7e52..e5132b5f6 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -6,6 +6,7 @@ import ( "fmt" "io/ioutil" "os" + "os/exec" "runtime" "strconv" "strings" @@ -17,6 +18,7 @@ import ( "github.com/containers/storage" "github.com/containers/storage/pkg/system" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // top-level "host" info @@ -44,6 +46,20 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) { "package": r.defaultOCIRuntime.conmonPackage(), "version": conmonVersion, } + if rootless.IsRootless() { + if path, err := exec.LookPath("slirp4netns"); err == nil { + logrus.Warnf("Failed to retrieve program version for %s: %v", path, err) + version, err := programVersion(path) + if err != nil { + logrus.Warnf("Failed to retrieve program version for %s: %v", path, err) + } + program := map[string]interface{}{} + program["Executable"] = path + program["Version"] = version + program["Package"] = packageVersion(path) + info["slirp4netns"] = program + } + } info["OCIRuntime"] = map[string]interface{}{ "path": r.defaultOCIRuntime.path, "package": r.defaultOCIRuntime.pathPackage(), @@ -53,7 +69,6 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) { "distribution": hostDistributionInfo["Distribution"], "version": hostDistributionInfo["Version"], } - info["BuildahVersion"] = buildah.Version kv, err := readKernelVersion() if err != nil { @@ -113,7 +128,24 @@ func (r *Runtime) storeInfo() (map[string]interface{}, error) { info["GraphRoot"] = r.store.GraphRoot() info["RunRoot"] = r.store.RunRoot() info["GraphDriverName"] = r.store.GraphDriverName() - info["GraphOptions"] = r.store.GraphOptions() + graphOptions := map[string]interface{}{} + for _, o := range r.store.GraphOptions() { + split := strings.SplitN(o, "=", 2) + if strings.HasSuffix(split[0], "mount_program") { + version, err := programVersion(split[1]) + if err != nil { + logrus.Warnf("Failed to retrieve program version for %s: %v", split[1], err) + } + program := map[string]interface{}{} + program["Executable"] = split[1] + program["Version"] = version + program["Package"] = packageVersion(split[1]) + graphOptions[split[0]] = program + } else { + graphOptions[split[0]] = split[1] + } + } + info["GraphOptions"] = graphOptions info["VolumePath"] = r.config.VolumePath configFile, err := storage.DefaultConfigFile(rootless.IsRootless()) |