diff options
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()) |