summaryrefslogtreecommitdiff
path: root/cmd/podman/info.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/info.go')
-rw-r--r--cmd/podman/info.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/cmd/podman/info.go b/cmd/podman/info.go
index c33ede548..3888829a3 100644
--- a/cmd/podman/info.go
+++ b/cmd/podman/info.go
@@ -1,11 +1,13 @@
package main
import (
- "runtime"
+ "fmt"
+ rt "runtime"
"github.com/containers/libpod/cmd/podman/formats"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/adapter"
+ "github.com/containers/libpod/version"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@@ -38,6 +40,7 @@ func infoCmd(c *cli.Context) error {
return err
}
info := map[string]interface{}{}
+ remoteClientInfo := map[string]interface{}{}
runtime, err := adapter.GetRuntime(c)
if err != nil {
@@ -49,9 +52,13 @@ func infoCmd(c *cli.Context) error {
if err != nil {
return errors.Wrapf(err, "error getting info")
}
+ if runtime.Remote {
+ remoteClientInfo["RemoteAPI Version"] = version.RemoteAPIVersion
+ remoteClientInfo["Podman Version"] = version.Version
+ remoteClientInfo["OS Arch"] = fmt.Sprintf("%s/%s", rt.GOOS, rt.GOARCH)
+ infoArr = append(infoArr, libpod.InfoData{Type: "client", Data: remoteClientInfo})
+ }
- // TODO This is no a problem child because we don't know if we should add information
- // TODO about the client or the backend. Only do for traditional podman for now.
if !runtime.Remote && c.Bool("debug") {
debugInfo := debugInfo(c)
infoArr = append(infoArr, libpod.InfoData{Type: "debug", Data: debugInfo})
@@ -80,8 +87,8 @@ func infoCmd(c *cli.Context) error {
// top-level "debug" info
func debugInfo(c *cli.Context) map[string]interface{} {
info := map[string]interface{}{}
- info["compiler"] = runtime.Compiler
- info["go version"] = runtime.Version()
+ info["compiler"] = rt.Compiler
+ info["go version"] = rt.Version()
info["podman version"] = c.App.Version
version, _ := libpod.GetVersion()
info["git commit"] = version.GitCommit