diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-06 16:45:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-06 16:45:25 +0200 |
commit | 575ffee2f05dc607d32da2d0bfd1b82f47aab8bb (patch) | |
tree | 1808f264855e5277034a2da4ac79a0bc2f278d9f /libpod/info.go | |
parent | 88980859eccacf7a5752952b4dfba6d25374ec2d (diff) | |
parent | b2b284111e49d3d953f71a794f25aa9ddfbb8568 (diff) | |
download | podman-575ffee2f05dc607d32da2d0bfd1b82f47aab8bb.tar.gz podman-575ffee2f05dc607d32da2d0bfd1b82f47aab8bb.tar.bz2 podman-575ffee2f05dc607d32da2d0bfd1b82f47aab8bb.zip |
Merge pull request #3918 from rhatdan/info
Return information about mount_program (fuse-overlayfs)
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()) |