summaryrefslogtreecommitdiff
path: root/libpod/oci_linux.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-08-06 11:35:29 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-07 14:16:26 +0000
commit33d6221ae34103d68753156ff2638802817dfa16 (patch)
tree11ed782c99565d37e33a178bf2da627ea1b33a77 /libpod/oci_linux.go
parentb1de943eea26bf1f6a6c599116cba3e7d9fe5d36 (diff)
downloadpodman-33d6221ae34103d68753156ff2638802817dfa16.tar.gz
podman-33d6221ae34103d68753156ff2638802817dfa16.tar.bz2
podman-33d6221ae34103d68753156ff2638802817dfa16.zip
Have info print conmon/oci runtime information
We need into to identify the OCI runtime and conmon used by podman. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1224 Approved by: baude
Diffstat (limited to 'libpod/oci_linux.go')
-rw-r--r--libpod/oci_linux.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/libpod/oci_linux.go b/libpod/oci_linux.go
index 2be7ee07c..e105680b7 100644
--- a/libpod/oci_linux.go
+++ b/libpod/oci_linux.go
@@ -8,6 +8,7 @@ import (
"os/exec"
"path/filepath"
"runtime"
+ "strings"
"sync"
"github.com/containerd/cgroups"
@@ -102,3 +103,20 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err e
return err
}
+
+func rpmVersion(path string) string {
+ output := "Unknown"
+ cmd := exec.Command("/usr/bin/rpm", "-q", "-f", path)
+ if outp, err := cmd.Output(); err == nil {
+ output = string(outp)
+ }
+ return strings.Trim(output, "\n")
+}
+
+func (r *OCIRuntime) pathPackage() string {
+ return rpmVersion(r.path)
+}
+
+func (r *OCIRuntime) conmonPackage() string {
+ return rpmVersion(r.conmonPath)
+}