mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
Update c/image and c/common to latest, c/buildah to main
... to include https://github.com/containers/image/pull/2173, https://github.com/containers/common/pull/1731 and https://github.com/containers/buildah/pull/5143 . Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
7
vendor/github.com/containers/buildah/pkg/util/util.go
generated
vendored
7
vendor/github.com/containers/buildah/pkg/util/util.go
generated
vendored
@@ -5,6 +5,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/buildah/pkg/parse"
|
||||
)
|
||||
|
||||
// Mirrors path to a tmpfile if path points to a
|
||||
@@ -17,7 +19,7 @@ import (
|
||||
func MirrorToTempFileIfPathIsDescriptor(file string) (string, bool) {
|
||||
// one use-case is discussed here
|
||||
// https://github.com/containers/buildah/issues/3070
|
||||
if !strings.HasPrefix(file, "/dev/fd") {
|
||||
if !strings.HasPrefix(file, "/dev/fd/") {
|
||||
return file, false
|
||||
}
|
||||
b, err := os.ReadFile(file)
|
||||
@@ -25,10 +27,11 @@ func MirrorToTempFileIfPathIsDescriptor(file string) (string, bool) {
|
||||
// if anything goes wrong return original path
|
||||
return file, false
|
||||
}
|
||||
tmpfile, err := os.CreateTemp(os.TempDir(), "buildah-temp-file")
|
||||
tmpfile, err := os.CreateTemp(parse.GetTempDir(), "buildah-temp-file")
|
||||
if err != nil {
|
||||
return file, false
|
||||
}
|
||||
defer tmpfile.Close()
|
||||
if _, err := tmpfile.Write(b); err != nil {
|
||||
// if anything goes wrong return original path
|
||||
return file, false
|
||||
|
||||
Reference in New Issue
Block a user