mirror of
https://github.com/containers/podman.git
synced 2025-09-27 08:43:52 +08:00
Update to the latest version of buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
18
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
18
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
@ -3,7 +3,6 @@
|
||||
package parse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@ -11,29 +10,16 @@ import (
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
"github.com/opencontainers/runc/libcontainer/devices"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func getDefaultProcessLimits() []string {
|
||||
rlim := unix.Rlimit{Cur: 1048576, Max: 1048576}
|
||||
defaultLimits := []string{}
|
||||
if err := unix.Setrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil {
|
||||
defaultLimits = append(defaultLimits, fmt.Sprintf("nofile=%d:%d", rlim.Cur, rlim.Max))
|
||||
}
|
||||
if err := unix.Setrlimit(unix.RLIMIT_NPROC, &rlim); err == nil {
|
||||
defaultLimits = append(defaultLimits, fmt.Sprintf("nproc=%d:%d", rlim.Cur, rlim.Max))
|
||||
}
|
||||
return defaultLimits
|
||||
}
|
||||
|
||||
func DeviceFromPath(device string) ([]configs.Device, error) {
|
||||
var devs []configs.Device
|
||||
src, dst, permissions, err := Device(device)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if unshare.IsRootless() {
|
||||
return nil, errors.Errorf("Renaming device %s to %s is not a supported in rootless containers", src, dst)
|
||||
if unshare.IsRootless() && src != dst {
|
||||
return nil, errors.Errorf("Renaming device %s to %s is not supported in rootless containers", src, dst)
|
||||
}
|
||||
srcInfo, err := os.Stat(src)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user