diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-16 05:02:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 05:02:03 -0800 |
commit | 39ef6d43d0b5a614228898180025835836673a8c (patch) | |
tree | 3501ed854691f101996d67ea7bfd16cf37c2e709 /libpod/oci_linux.go | |
parent | 53c47b9061bcee28c1777c331ab6ede2a7e0dc37 (diff) | |
parent | e93834576036ef0a5e1d5867e522d1d90a63d358 (diff) | |
download | podman-39ef6d43d0b5a614228898180025835836673a8c.tar.gz podman-39ef6d43d0b5a614228898180025835836673a8c.tar.bz2 podman-39ef6d43d0b5a614228898180025835836673a8c.zip |
Merge pull request #1756 from isimluk/update-dependent-metalinter
Update metalinter dependency
Diffstat (limited to 'libpod/oci_linux.go')
-rw-r--r-- | libpod/oci_linux.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/oci_linux.go b/libpod/oci_linux.go index e6b7cbe4f..b159eae78 100644 --- a/libpod/oci_linux.go +++ b/libpod/oci_linux.go @@ -19,6 +19,8 @@ import ( "golang.org/x/sys/unix" ) +const unknownPackage = "Unknown" + func (r *OCIRuntime) moveConmonToCgroup(ctr *Container, cgroupParent string, cmd *exec.Cmd) error { if os.Geteuid() == 0 { if r.cgroupManager == SystemdCgroupsManager { @@ -112,7 +114,7 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string, restor } func rpmVersion(path string) string { - output := "Unknown" + output := unknownPackage cmd := exec.Command("/usr/bin/rpm", "-q", "-f", path) if outp, err := cmd.Output(); err == nil { output = string(outp) @@ -121,7 +123,7 @@ func rpmVersion(path string) string { } func dpkgVersion(path string) string { - output := "Unknown" + output := unknownPackage cmd := exec.Command("/usr/bin/dpkg", "-S", path) if outp, err := cmd.Output(); err == nil { output = string(outp) @@ -130,14 +132,14 @@ func dpkgVersion(path string) string { } func (r *OCIRuntime) pathPackage() string { - if out := rpmVersion(r.path); out != "Unknown" { + if out := rpmVersion(r.path); out != unknownPackage { return out } return dpkgVersion(r.path) } func (r *OCIRuntime) conmonPackage() string { - if out := rpmVersion(r.conmonPath); out != "Unknown" { + if out := rpmVersion(r.conmonPath); out != unknownPackage { return out } return dpkgVersion(r.conmonPath) |