summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi/util.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-04-09 13:07:27 -0500
committerbaude <bbaude@redhat.com>2019-04-09 15:00:35 -0500
commit23cd1928ec36a80f491b329dda3789b2dac32bcc (patch)
treec52ef533642c22cb3483790afe57e810ac615112 /pkg/varlinkapi/util.go
parentfe79bdd07e140176dc64ebef8da3eea2ae28b96b (diff)
downloadpodman-23cd1928ec36a80f491b329dda3789b2dac32bcc.tar.gz
podman-23cd1928ec36a80f491b329dda3789b2dac32bcc.tar.bz2
podman-23cd1928ec36a80f491b329dda3789b2dac32bcc.zip
podman-remote ps
add the ability to run ps on containers using the remote client. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/varlinkapi/util.go')
-rw-r--r--pkg/varlinkapi/util.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/varlinkapi/util.go b/pkg/varlinkapi/util.go
index 3c4b9b79a..8716c963a 100644
--- a/pkg/varlinkapi/util.go
+++ b/pkg/varlinkapi/util.go
@@ -162,3 +162,36 @@ func stringPullPolicyToType(s string) buildah.PullPolicy {
}
return buildah.PullIfMissing
}
+
+func derefBool(inBool *bool) bool {
+ if inBool == nil {
+ return false
+ }
+ return *inBool
+}
+
+func derefString(in *string) string {
+ if in == nil {
+ return ""
+ }
+ return *in
+}
+
+func makePsOpts(inOpts iopodman.PsOpts) shared.PsOptions {
+ last := 0
+ if inOpts.Last != nil {
+ lastT := *inOpts.Last
+ last = int(lastT)
+ }
+ return shared.PsOptions{
+ All: inOpts.All,
+ Last: last,
+ Latest: derefBool(inOpts.Latest),
+ NoTrunc: derefBool(inOpts.NoTrunc),
+ Pod: derefBool(inOpts.Pod),
+ Size: true,
+ Sort: derefString(inOpts.Sort),
+ Namespace: true,
+ Sync: derefBool(inOpts.Sync),
+ }
+}