mirror of
https://github.com/containers/podman.git
synced 2025-09-27 16:54:42 +08:00
Update vendor of Buildah and imagebuilder
Fixes the testing issues we are hitting. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
20
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
20
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -319,7 +320,7 @@ func getDockerAuth(creds string) (*types.DockerAuthConfig, error) {
|
||||
}
|
||||
|
||||
// IDMappingOptions parses the build options related to user namespaces and ID mapping.
|
||||
func IDMappingOptions(c *cobra.Command) (usernsOptions buildah.NamespaceOptions, idmapOptions *buildah.IDMappingOptions, err error) {
|
||||
func IDMappingOptions(c *cobra.Command, isolation buildah.Isolation) (usernsOptions buildah.NamespaceOptions, idmapOptions *buildah.IDMappingOptions, err error) {
|
||||
user := c.Flag("userns-uid-map-user").Value.String()
|
||||
group := c.Flag("userns-gid-map-group").Value.String()
|
||||
// If only the user or group was specified, use the same value for the
|
||||
@ -391,11 +392,26 @@ func IDMappingOptions(c *cobra.Command) (usernsOptions buildah.NamespaceOptions,
|
||||
if len(gidmap) == 0 && len(uidmap) != 0 {
|
||||
gidmap = uidmap
|
||||
}
|
||||
|
||||
useSlirp4netns := false
|
||||
|
||||
if isolation == buildah.IsolationOCIRootless {
|
||||
_, err := exec.LookPath("slirp4netns")
|
||||
if execerr, ok := err.(*exec.Error); ok && !strings.Contains(execerr.Error(), "not found") {
|
||||
return nil, nil, errors.Wrapf(err, "cannot lookup slirp4netns %v", execerr)
|
||||
}
|
||||
if err == nil {
|
||||
useSlirp4netns = true
|
||||
} else {
|
||||
logrus.Warningf("could not find slirp4netns. Using host network namespace")
|
||||
}
|
||||
}
|
||||
|
||||
// By default, having mappings configured means we use a user
|
||||
// namespace. Otherwise, we don't.
|
||||
usernsOption := buildah.NamespaceOption{
|
||||
Name: string(specs.UserNamespace),
|
||||
Host: len(uidmap) == 0 && len(gidmap) == 0,
|
||||
Host: len(uidmap) == 0 && len(gidmap) == 0 && !useSlirp4netns,
|
||||
}
|
||||
// If the user specifically requested that we either use or don't use
|
||||
// user namespaces, override that default.
|
||||
|
Reference in New Issue
Block a user