diff options
author | baude <bbaude@redhat.com> | 2019-04-28 09:12:59 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-05-01 09:13:18 -0500 |
commit | adbc41a3f73fc5b7dcfacb3438b4ede6609f24ee (patch) | |
tree | 47395fd6da0d6747ff196e32f349218f1e0a3694 /pkg/adapter/runtime_remote.go | |
parent | eea77b5ae3e7fb8a60d438a79d3a4b30d35bb67c (diff) | |
download | podman-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.go | 17 |
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 +} |