mirror of
https://github.com/containers/podman.git
synced 2025-09-27 08:43:52 +08:00
bump containers/image to v5.0.0, buildah to v1.11.4
Move to containers/image v5 and containers/buildah to v1.11.4. Replace an equality check with a type assertion when checking for a docker.ErrUnauthorizedForCredentials in `podman login`. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
8
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
@ -14,7 +14,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/containers/buildah"
|
||||
"github.com/containers/image/v4/types"
|
||||
"github.com/containers/image/v5/types"
|
||||
"github.com/containers/storage/pkg/idtools"
|
||||
units "github.com/docker/go-units"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
@ -583,6 +583,12 @@ func SystemContextFromOptions(c *cobra.Command) (*types.SystemContext, error) {
|
||||
ctx.RegistriesDirPath = regConfDir
|
||||
}
|
||||
ctx.DockerRegistryUserAgent = fmt.Sprintf("Buildah/%s", buildah.Version)
|
||||
if os, err := c.Flags().GetString("override-os"); err == nil {
|
||||
ctx.OSChoice = os
|
||||
}
|
||||
if arch, err := c.Flags().GetString("override-arch"); err == nil {
|
||||
ctx.ArchitectureChoice = arch
|
||||
}
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
|
38
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
38
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
@ -4,6 +4,8 @@ package parse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/containers/buildah/pkg/unshare"
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
@ -24,18 +26,40 @@ func getDefaultProcessLimits() []string {
|
||||
return defaultLimits
|
||||
}
|
||||
|
||||
func DeviceFromPath(device string) (configs.Device, error) {
|
||||
func DeviceFromPath(device string) ([]configs.Device, error) {
|
||||
var devs []configs.Device
|
||||
src, dst, permissions, err := Device(device)
|
||||
if err != nil {
|
||||
return configs.Device{}, err
|
||||
return nil, err
|
||||
}
|
||||
if unshare.IsRootless() {
|
||||
return configs.Device{}, errors.Errorf("Renaming device %s to %s is not a supported in rootless containers", src, dst)
|
||||
return nil, errors.Errorf("Renaming device %s to %s is not a supported in rootless containers", src, dst)
|
||||
}
|
||||
dev, err := devices.DeviceFromPath(src, permissions)
|
||||
srcInfo, err := os.Stat(src)
|
||||
if err != nil {
|
||||
return configs.Device{}, errors.Wrapf(err, "%s is not a valid device", src)
|
||||
return nil, errors.Wrapf(err, "error getting info of source device %s", src)
|
||||
}
|
||||
dev.Path = dst
|
||||
return *dev, nil
|
||||
|
||||
if !srcInfo.IsDir() {
|
||||
|
||||
dev, err := devices.DeviceFromPath(src, permissions)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "%s is not a valid device", src)
|
||||
}
|
||||
dev.Path = dst
|
||||
devs = append(devs, *dev)
|
||||
return devs, nil
|
||||
}
|
||||
|
||||
// If source device is a directory
|
||||
srcDevices, err := devices.GetDevices(src)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error getting source devices from directory %s", src)
|
||||
}
|
||||
for _, d := range srcDevices {
|
||||
d.Path = filepath.Join(dst, filepath.Base(d.Path))
|
||||
d.Permissions = permissions
|
||||
devs = append(devs, *d)
|
||||
}
|
||||
return devs, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user