mirror of
https://github.com/containers/podman.git
synced 2025-12-03 03:39:44 +08:00
vendor: update c/{buildah,common,image,storage} to main
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
9
vendor/github.com/containers/common/pkg/parse/parse_unix.go
generated
vendored
9
vendor/github.com/containers/common/pkg/parse/parse_unix.go
generated
vendored
@@ -8,10 +8,11 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/containers/storage/pkg/unshare"
|
||||
"github.com/opencontainers/cgroups/devices/config"
|
||||
"github.com/opencontainers/runc/libcontainer/devices"
|
||||
)
|
||||
|
||||
func DeviceFromPath(device string) ([]devices.Device, error) {
|
||||
func DeviceFromPath(device string) ([]config.Device, error) {
|
||||
src, dst, permissions, err := Device(device)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -25,7 +26,7 @@ func DeviceFromPath(device string) ([]devices.Device, error) {
|
||||
}
|
||||
|
||||
if !srcInfo.IsDir() {
|
||||
devs := make([]devices.Device, 0, 1)
|
||||
devs := make([]config.Device, 0, 1)
|
||||
dev, err := devices.DeviceFromPath(src, permissions)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s is not a valid device: %w", src, err)
|
||||
@@ -40,10 +41,10 @@ func DeviceFromPath(device string) ([]devices.Device, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("getting source devices from directory %s: %w", src, err)
|
||||
}
|
||||
devs := make([]devices.Device, 0, len(srcDevices))
|
||||
devs := make([]config.Device, 0, len(srcDevices))
|
||||
for _, d := range srcDevices {
|
||||
d.Path = filepath.Join(dst, filepath.Base(d.Path))
|
||||
d.Permissions = devices.Permissions(permissions)
|
||||
d.Permissions = config.Permissions(permissions)
|
||||
devs = append(devs, *d)
|
||||
}
|
||||
return devs, nil
|
||||
|
||||
Reference in New Issue
Block a user