summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime_remote.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-04-28 09:12:59 -0500
committerbaude <bbaude@redhat.com>2019-05-01 09:13:18 -0500
commitadbc41a3f73fc5b7dcfacb3438b4ede6609f24ee (patch)
tree47395fd6da0d6747ff196e32f349218f1e0a3694 /pkg/adapter/runtime_remote.go
parenteea77b5ae3e7fb8a60d438a79d3a4b30d35bb67c (diff)
downloadpodman-adbc41a3f73fc5b7dcfacb3438b4ede6609f24ee.tar.gz
podman-adbc41a3f73fc5b7dcfacb3438b4ede6609f24ee.tar.bz2
podman-adbc41a3f73fc5b7dcfacb3438b4ede6609f24ee.zip
podman-remote port
add the port command to the remote client. this allows users to displa port information about their host system from the remote client Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/adapter/runtime_remote.go')
-rw-r--r--pkg/adapter/runtime_remote.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go
index 6102daccf..4986d16f7 100644
--- a/pkg/adapter/runtime_remote.go
+++ b/pkg/adapter/runtime_remote.go
@@ -889,3 +889,20 @@ func (r *LocalRuntime) GenerateKube(c *cliconfig.GenerateKubeValues) (*v1.Pod, *
err = json.Unmarshal([]byte(reply.Service), &service)
return &pod, &service, err
}
+
+// GetContainersByContext looks up containers based on the cli input of all, latest, or a list
+func (r *LocalRuntime) GetContainersByContext(all bool, latest bool, namesOrIDs []string) ([]*Container, error) {
+ var containers []*Container
+ cids, err := iopodman.GetContainersByContext().Call(r.Conn, all, latest, namesOrIDs)
+ if err != nil {
+ return nil, err
+ }
+ for _, cid := range cids {
+ ctr, err := r.LookupContainer(cid)
+ if err != nil {
+ return nil, err
+ }
+ containers = append(containers, ctr)
+ }
+ return containers, nil
+}