diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-22 15:28:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 15:28:19 +0100 |
commit | 7838a13b61ee893a6dad5cf4cc4e36c5ab74b855 (patch) | |
tree | 84f0df8442d5fd412c9b2838260e9d5cc16c989b /cmd/podman/info.go | |
parent | ec969875fa13e90f4ce696e9d24b86a02f79f54a (diff) | |
parent | 5c8e7ed0dee117c9d423849f09f82d15957893a8 (diff) | |
download | podman-7838a13b61ee893a6dad5cf4cc4e36c5ab74b855.tar.gz podman-7838a13b61ee893a6dad5cf4cc4e36c5ab74b855.tar.bz2 podman-7838a13b61ee893a6dad5cf4cc4e36c5ab74b855.zip |
Merge pull request #2199 from baude/remoteversion
enable podman-remote version
Diffstat (limited to 'cmd/podman/info.go')
-rw-r--r-- | cmd/podman/info.go | 17 |
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 |