mirror of
https://github.com/containers/podman.git
synced 2025-09-27 00:34:32 +08:00
Vendor Bulidah 1.11.2
Vendor in Buildah 1.11.2 into libpod/Podman Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
20
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
20
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
@ -5,6 +5,10 @@ package parse
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/containers/buildah/pkg/unshare"
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
"github.com/opencontainers/runc/libcontainer/devices"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
@ -19,3 +23,19 @@ func getDefaultProcessLimits() []string {
|
||||
}
|
||||
return defaultLimits
|
||||
}
|
||||
|
||||
func DeviceFromPath(device string) (configs.Device, error) {
|
||||
src, dst, permissions, err := Device(device)
|
||||
if err != nil {
|
||||
return configs.Device{}, err
|
||||
}
|
||||
if unshare.IsRootless() {
|
||||
return configs.Device{}, errors.Errorf("Renaming device %s to %s is not a supported in rootless containers", src, dst)
|
||||
}
|
||||
dev, err := devices.DeviceFromPath(src, permissions)
|
||||
if err != nil {
|
||||
return configs.Device{}, errors.Wrapf(err, "%s is not a valid device", src)
|
||||
}
|
||||
dev.Path = dst
|
||||
return *dev, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user