From b2b284111e49d3d953f71a794f25aa9ddfbb8568 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sat, 31 Aug 2019 07:19:39 -0400 Subject: 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 --- libpod/oci_linux.go | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'libpod/oci_linux.go') 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 -- cgit v1.2.3-54-g00ecf