From 5d94cc4ff59d5694467a05b8dabf91fe5739f668 Mon Sep 17 00:00:00 2001 From: Evan Cordell <cordell.evan@gmail.com> Date: Fri, 29 May 2020 14:59:07 -0400 Subject: [PATCH] fix(copy): make tmpdir relative to current directory /tmp may not exist in all images. --- pkg/lib/tmp/copy.go | 2 +- test/e2e/opm_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/lib/tmp/copy.go b/pkg/lib/tmp/copy.go index 52a247f41..c61e04c6a 100644 --- a/pkg/lib/tmp/copy.go +++ b/pkg/lib/tmp/copy.go @@ -9,7 +9,7 @@ import ( // CopyTmpDB reads the file at the given path and copies it to a tmp directory, returning the copied file path or an err func CopyTmpDB(original string) (path string, err error) { - dst, err := ioutil.TempFile("", "db-") + dst, err := ioutil.TempFile(".", "db-") if err != nil { return "", err } diff --git a/test/e2e/opm_test.go b/test/e2e/opm_test.go index e7a8bf139..e2b219ca0 100644 --- a/test/e2e/opm_test.go +++ b/test/e2e/opm_test.go @@ -47,7 +47,7 @@ var ( ) func inTemporaryBuildContext(f func() error) (rerr error) { - td, err := ioutil.TempDir("", "opm-") + td, err := ioutil.TempDir(".", "opm-") if err != nil { return err }