summaryrefslogtreecommitdiff
path: root/cmd/podman/info.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2019-05-16 10:01:37 -0700
committerJhon Honce <jhonce@redhat.com>2019-05-16 11:03:22 -0700
commita1c654de94738802b850edfad9502fca5dd26a59 (patch)
treefa7bfd26406edb8192e57d91f43ed98e5aceb8a8 /cmd/podman/info.go
parenta261b60cc8851c04efd191be6f6e2e4598439822 (diff)
downloadpodman-a1c654de94738802b850edfad9502fca5dd26a59.tar.gz
podman-a1c654de94738802b850edfad9502fca5dd26a59.tar.bz2
podman-a1c654de94738802b850edfad9502fca5dd26a59.zip
Add connection information to podman-remote info
Refactor client code to break out building connection string from making the connection. Example: client: Connection: unix:/run/podman/io.podman Connection Type: DirectConnection . : Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/info.go')
-rw-r--r--cmd/podman/info.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/info.go b/cmd/podman/info.go
index a6fce7fcb..823303354 100644
--- a/cmd/podman/info.go
+++ b/cmd/podman/info.go
@@ -10,6 +10,7 @@ import (
"github.com/containers/libpod/pkg/adapter"
"github.com/containers/libpod/version"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@@ -60,7 +61,16 @@ func infoCmd(c *cliconfig.InfoValues) error {
if err != nil {
return errors.Wrapf(err, "error getting info")
}
+
if runtime.Remote {
+ endpoint, err := runtime.RemoteEndpoint()
+ if err != nil {
+ logrus.Errorf("Failed to obtain server connection: %s", err.Error())
+ } else {
+ remoteClientInfo["Connection"] = endpoint.Connection
+ remoteClientInfo["Connection Type"] = endpoint.Type.String()
+ }
+
remoteClientInfo["RemoteAPI Version"] = version.RemoteAPIVersion
remoteClientInfo["Podman Version"] = version.Version
remoteClientInfo["OS Arch"] = fmt.Sprintf("%s/%s", rt.GOOS, rt.GOARCH)