summaryrefslogtreecommitdiff
path: root/libpod/oci_linux.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-08-31 07:19:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-09-06 07:32:42 -0400
commitb2b284111e49d3d953f71a794f25aa9ddfbb8568 (patch)
tree280582a73cb3c3cc080517c5fdaafbbf90846fe0 /libpod/oci_linux.go
parenta4572c4f681ef23495495f313ae513d5ba3fd495 (diff)
downloadpodman-b2b284111e49d3d953f71a794f25aa9ddfbb8568.tar.gz
podman-b2b284111e49d3d953f71a794f25aa9ddfbb8568.tar.bz2
podman-b2b284111e49d3d953f71a794f25aa9ddfbb8568.zip
Return information about mount_program (fuse-overlayfs)
We want to get podman info to tell us about the version of the mount program to help us diagnose issues users are having. Also if in rootless mode and slirp4netns is installed reveal package info on slirp4netns. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/oci_linux.go')
-rw-r--r--libpod/oci_linux.go30
1 files changed, 2 insertions, 28 deletions
diff --git a/libpod/oci_linux.go b/libpod/oci_linux.go
index 1613c3e68..6dba1260c 100644
--- a/libpod/oci_linux.go
+++ b/libpod/oci_linux.go
@@ -24,8 +24,6 @@ import (
"k8s.io/client-go/tools/remotecommand"
)
-const unknownPackage = "Unknown"
-
// makeAccessible changes the path permission and each parent directory to have --x--x--x
func makeAccessible(path string, uid, gid int) error {
for ; path != "/"; path = filepath.Dir(path) {
@@ -114,36 +112,12 @@ func (r *OCIRuntime) createContainer(ctr *Container, restoreOptions *ContainerCh
return r.createOCIContainer(ctr, restoreOptions)
}
-func rpmVersion(path string) string {
- output := unknownPackage
- 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 dpkgVersion(path string) string {
- output := unknownPackage
- cmd := exec.Command("/usr/bin/dpkg", "-S", path)
- if outp, err := cmd.Output(); err == nil {
- output = string(outp)
- }
- return strings.Trim(output, "\n")
-}
-
func (r *OCIRuntime) pathPackage() string {
- if out := rpmVersion(r.path); out != unknownPackage {
- return out
- }
- return dpkgVersion(r.path)
+ return packageVersion(r.path)
}
func (r *OCIRuntime) conmonPackage() string {
- if out := rpmVersion(r.conmonPath); out != unknownPackage {
- return out
- }
- return dpkgVersion(r.conmonPath)
+ return packageVersion(r.conmonPath)
}
// execContainer executes a command in a running container