summaryrefslogtreecommitdiff
path: root/libpod/adapter/pods.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-02-21 15:12:04 -0600
committerbaude <bbaude@redhat.com>2019-02-22 11:08:04 -0600
commitbc6b4aa39c9156f31a5d370b19e91f42e0f14181 (patch)
tree04300664a1b58b4a8d24681efb6db36560282a80 /libpod/adapter/pods.go
parentb4c10790d514538277a937a443219e4310cb057f (diff)
downloadpodman-bc6b4aa39c9156f31a5d370b19e91f42e0f14181.tar.gz
podman-bc6b4aa39c9156f31a5d370b19e91f42e0f14181.tar.bz2
podman-bc6b4aa39c9156f31a5d370b19e91f42e0f14181.zip
podman-remote pod inspect|exists
enable the remote client to be able to inspect a pod. also, bonus of enabling the podman pod exists command which returns a 0 or 1 depending on whether the given pod exists. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/adapter/pods.go')
-rw-r--r--libpod/adapter/pods.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/adapter/pods.go b/libpod/adapter/pods.go
index 59642c42e..9841c20c0 100644
--- a/libpod/adapter/pods.go
+++ b/libpod/adapter/pods.go
@@ -36,3 +36,19 @@ func (r *LocalRuntime) RemovePods(ctx context.Context, cli *cliconfig.PodRmValue
}
return podids, errs
}
+
+// GetLatestPod gets the latest pod and wraps it in an adapter pod
+func (r *LocalRuntime) GetLatestPod() (*Pod, error) {
+ pod := Pod{}
+ p, err := r.Runtime.GetLatestPod()
+ pod.Pod = p
+ return &pod, err
+}
+
+// LookupPod gets a pod by name or id and wraps it in an adapter pod
+func (r *LocalRuntime) LookupPod(nameOrID string) (*Pod, error) {
+ pod := Pod{}
+ p, err := r.Runtime.LookupPod(nameOrID)
+ pod.Pod = p
+ return &pod, err
+}