diff options
Diffstat (limited to 'libpod/oci_linux.go')
-rw-r--r-- | libpod/oci_linux.go | 18 |
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) +} |