From bc6b4aa39c9156f31a5d370b19e91f42e0f14181 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 21 Feb 2019 15:12:04 -0600 Subject: 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 --- libpod/adapter/pods.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libpod/adapter/pods.go') 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 +} -- cgit v1.2.3-54-g00ecf