summaryrefslogtreecommitdiff
path: root/libpod/oci_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-06 16:45:25 +0200
committerGitHub <noreply@github.com>2019-09-06 16:45:25 +0200
commit575ffee2f05dc607d32da2d0bfd1b82f47aab8bb (patch)
tree1808f264855e5277034a2da4ac79a0bc2f278d9f /libpod/oci_linux.go
parent88980859eccacf7a5752952b4dfba6d25374ec2d (diff)
parentb2b284111e49d3d953f71a794f25aa9ddfbb8568 (diff)
downloadpodman-575ffee2f05dc607d32da2d0bfd1b82f47aab8bb.tar.gz
podman-575ffee2f05dc607d32da2d0bfd1b82f47aab8bb.tar.bz2
podman-575ffee2f05dc607d32da2d0bfd1b82f47aab8bb.zip
Merge pull request #3918 from rhatdan/info
Return information about mount_program (fuse-overlayfs)
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