summaryrefslogtreecommitdiff
path: root/cmd/podman/info.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-01-21 15:18:13 -0600
committerbaude <bbaude@redhat.com>2019-01-21 15:23:30 -0600
commit5c8e7ed0dee117c9d423849f09f82d15957893a8 (patch)
treef5244f8cabf513a409a69b72f2c97d0d0e5d996c /cmd/podman/info.go
parentba3509665c16365870ae2c50c6798c0e8489cb78 (diff)
downloadpodman-5c8e7ed0dee117c9d423849f09f82d15957893a8.tar.gz
podman-5c8e7ed0dee117c9d423849f09f82d15957893a8.tar.bz2
podman-5c8e7ed0dee117c9d423849f09f82d15957893a8.zip
enable podman-remote version
initial enablement of podman-remote version. includes add a APIVersion const that will allow us to check compatibility between host/client when connections are made. also added client related information to podman info. Signed-off-by: baude <bbaude@redhat.com>
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