summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-12-02 18:03:30 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-12-02 18:03:33 +0100
commite13e5502e3f6c5f2e991ec577fea25a4c77b6b81 (patch)
treea6cc80e1bed351f3c8f19b9059a7b8d54c57b91e
parente4275b3453598c3cdcf1ee00ff73c55780aef444 (diff)
downloadpodman-e13e5502e3f6c5f2e991ec577fea25a4c77b6b81.tar.gz
podman-e13e5502e3f6c5f2e991ec577fea25a4c77b6b81.tar.bz2
podman-e13e5502e3f6c5f2e991ec577fea25a4c77b6b81.zip
libpod: fix case for executable file not found errors
do not change the runtime error to be lowercase, but use a case insensitive regex matching. In this way the original error from the OCI runtime is reported back. regression introduced by bc485bce47f55135d6ead80537bc145edb779ae9 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--libpod/oci_util.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/libpod/oci_util.go b/libpod/oci_util.go
index 3345220ac..53567d2d0 100644
--- a/libpod/oci_util.go
+++ b/libpod/oci_util.go
@@ -82,18 +82,16 @@ func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) {
}
func getOCIRuntimeError(runtimeMsg string) error {
- r := strings.ToLower(runtimeMsg)
-
includeFullOutput := logrus.GetLevel() == logrus.DebugLevel
- if match := regexp.MustCompile(".*permission denied.*|.*operation not permitted.*").FindString(r); match != "" {
+ if match := regexp.MustCompile("(?i).*permission denied.*|.*operation not permitted.*").FindString(runtimeMsg); match != "" {
errStr := match
if includeFullOutput {
errStr = runtimeMsg
}
return errors.Wrapf(define.ErrOCIRuntimePermissionDenied, "%s", strings.Trim(errStr, "\n"))
}
- if match := regexp.MustCompile(".*executable file not found in.*|.*no such file or directory.*").FindString(r); match != "" {
+ if match := regexp.MustCompile("(?i).*executable file not found in.*|.*no such file or directory.*").FindString(runtimeMsg); match != "" {
errStr := match
if includeFullOutput {
errStr = runtimeMsg