mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Bump Buildah vendor to pick up fix for tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #878 Approved by: mheon
This commit is contained in:
@ -88,7 +88,7 @@ k8s.io/kube-openapi 275e2ce91dec4c05a4094a7b1daee5560b555ac9 https://github.com/
|
|||||||
k8s.io/utils 258e2a2fa64568210fbd6267cf1d8fd87c3cb86e https://github.com/kubernetes/utils
|
k8s.io/utils 258e2a2fa64568210fbd6267cf1d8fd87c3cb86e https://github.com/kubernetes/utils
|
||||||
github.com/mrunalp/fileutils master
|
github.com/mrunalp/fileutils master
|
||||||
github.com/varlink/go master
|
github.com/varlink/go master
|
||||||
github.com/projectatomic/buildah b66e8531456e2986ffc409f591c9005813589a34
|
github.com/projectatomic/buildah 01a443f7382025264e27ec95ea203ab9314677a2
|
||||||
github.com/Nvveen/Gotty master
|
github.com/Nvveen/Gotty master
|
||||||
github.com/fsouza/go-dockerclient master
|
github.com/fsouza/go-dockerclient master
|
||||||
github.com/openshift/imagebuilder master
|
github.com/openshift/imagebuilder master
|
||||||
|
67
vendor/github.com/projectatomic/buildah/run.go
generated
vendored
67
vendor/github.com/projectatomic/buildah/run.go
generated
vendored
@ -285,8 +285,7 @@ func addCommonOptsToSpec(commonOpts *CommonBuildOptions, g *generate.Generator)
|
|||||||
|
|
||||||
func (b *Builder) setupMounts(mountPoint string, spec *specs.Spec, optionMounts []specs.Mount, bindFiles map[string]string, builtinVolumes, volumeMounts []string, shmSize string, namespaceOptions NamespaceOptions) error {
|
func (b *Builder) setupMounts(mountPoint string, spec *specs.Spec, optionMounts []specs.Mount, bindFiles map[string]string, builtinVolumes, volumeMounts []string, shmSize string, namespaceOptions NamespaceOptions) error {
|
||||||
// Start building a new list of mounts.
|
// Start building a new list of mounts.
|
||||||
mounts := make([]specs.Mount, len(optionMounts))
|
var mounts []specs.Mount
|
||||||
copy(mounts, optionMounts)
|
|
||||||
haveMount := func(destination string) bool {
|
haveMount := func(destination string) bool {
|
||||||
for _, mount := range mounts {
|
for _, mount := range mounts {
|
||||||
if mount.Destination == destination {
|
if mount.Destination == destination {
|
||||||
@ -396,7 +395,7 @@ func (b *Builder) setupMounts(mountPoint string, spec *specs.Spec, optionMounts
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the list of explicitly-specified volume mounts.
|
// Get the list of explicitly-specified volume mounts.
|
||||||
volumes, err := runSetupVolumeMounts(spec.Linux.MountLabel, volumeMounts)
|
volumes, err := runSetupVolumeMounts(spec.Linux.MountLabel, volumeMounts, optionMounts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -460,17 +459,10 @@ func runSetupBuiltinVolumes(mountLabel, mountPoint, containerDir string, copyWit
|
|||||||
return mounts, nil
|
return mounts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func runSetupVolumeMounts(mountLabel string, volumeMounts []string) ([]specs.Mount, error) {
|
func runSetupVolumeMounts(mountLabel string, volumeMounts []string, optionMounts []specs.Mount) ([]specs.Mount, error) {
|
||||||
var mounts []specs.Mount
|
var mounts []specs.Mount
|
||||||
|
|
||||||
// Bind mount volumes given by the user at execution
|
parseMount := func(host, container string, options []string) (specs.Mount, error) {
|
||||||
for _, i := range volumeMounts {
|
|
||||||
var options []string
|
|
||||||
spliti := strings.Split(i, ":")
|
|
||||||
if len(spliti) > 2 {
|
|
||||||
options = strings.Split(spliti[2], ",")
|
|
||||||
}
|
|
||||||
options = append(options, "rbind")
|
|
||||||
var foundrw, foundro, foundz, foundZ bool
|
var foundrw, foundro, foundz, foundZ bool
|
||||||
var rootProp string
|
var rootProp string
|
||||||
for _, opt := range options {
|
for _, opt := range options {
|
||||||
@ -491,25 +483,46 @@ func runSetupVolumeMounts(mountLabel string, volumeMounts []string) ([]specs.Mou
|
|||||||
options = append(options, "rw")
|
options = append(options, "rw")
|
||||||
}
|
}
|
||||||
if foundz {
|
if foundz {
|
||||||
if err := label.Relabel(spliti[0], mountLabel, true); err != nil {
|
if err := label.Relabel(host, mountLabel, true); err != nil {
|
||||||
return nil, errors.Wrapf(err, "relabeling %q failed", spliti[0])
|
return specs.Mount{}, errors.Wrapf(err, "relabeling %q failed", host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if foundZ {
|
if foundZ {
|
||||||
if err := label.Relabel(spliti[0], mountLabel, false); err != nil {
|
if err := label.Relabel(host, mountLabel, false); err != nil {
|
||||||
return nil, errors.Wrapf(err, "relabeling %q failed", spliti[0])
|
return specs.Mount{}, errors.Wrapf(err, "relabeling %q failed", host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if rootProp == "" {
|
if rootProp == "" {
|
||||||
options = append(options, "private")
|
options = append(options, "private")
|
||||||
}
|
}
|
||||||
|
return specs.Mount{
|
||||||
mounts = append(mounts, specs.Mount{
|
Destination: container,
|
||||||
Destination: spliti[1],
|
|
||||||
Type: "bind",
|
Type: "bind",
|
||||||
Source: spliti[0],
|
Source: host,
|
||||||
Options: options,
|
Options: options,
|
||||||
})
|
}, nil
|
||||||
|
}
|
||||||
|
// Bind mount volumes specified for this particular Run() invocation
|
||||||
|
for _, i := range optionMounts {
|
||||||
|
mount, err := parseMount(i.Source, i.Destination, append(i.Options, "rbind"))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
mounts = append(mounts, mount)
|
||||||
|
}
|
||||||
|
// Bind mount volumes given by the user when the container was created
|
||||||
|
for _, i := range volumeMounts {
|
||||||
|
var options []string
|
||||||
|
spliti := strings.Split(i, ":")
|
||||||
|
if len(spliti) > 2 {
|
||||||
|
options = strings.Split(spliti[2], ",")
|
||||||
|
}
|
||||||
|
options = append(options, "rbind")
|
||||||
|
mount, err := parseMount(spliti[0], spliti[1], options)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
mounts = append(mounts, mount)
|
||||||
}
|
}
|
||||||
return mounts, nil
|
return mounts, nil
|
||||||
}
|
}
|
||||||
@ -692,7 +705,13 @@ func setupNamespaces(g *generate.Generator, namespaceOptions NamespaceOptions, i
|
|||||||
// Run runs the specified command in the container's root filesystem.
|
// Run runs the specified command in the container's root filesystem.
|
||||||
func (b *Builder) Run(command []string, options RunOptions) error {
|
func (b *Builder) Run(command []string, options RunOptions) error {
|
||||||
var user specs.User
|
var user specs.User
|
||||||
path, err := ioutil.TempDir(os.TempDir(), Package)
|
p, err := ioutil.TempDir(os.TempDir(), Package)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// On some hosts like AH, /tmp is a symlink and we need an
|
||||||
|
// absolute path.
|
||||||
|
path, err := filepath.EvalSymlinks(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -976,6 +995,7 @@ func runUsingRuntime(options RunOptions, configureNetwork bool, configureNetwork
|
|||||||
// Figure out how we're doing stdio handling, and create pipes and sockets.
|
// Figure out how we're doing stdio handling, and create pipes and sockets.
|
||||||
var stdio sync.WaitGroup
|
var stdio sync.WaitGroup
|
||||||
var consoleListener *net.UnixListener
|
var consoleListener *net.UnixListener
|
||||||
|
var errorFds []int
|
||||||
stdioPipe := make([][]int, 3)
|
stdioPipe := make([][]int, 3)
|
||||||
copyConsole := false
|
copyConsole := false
|
||||||
copyStdio := false
|
copyStdio := false
|
||||||
@ -1006,6 +1026,7 @@ func runUsingRuntime(options RunOptions, configureNetwork bool, configureNetwork
|
|||||||
if stdioPipe, err = runMakeStdioPipe(int(uid), int(gid)); err != nil {
|
if stdioPipe, err = runMakeStdioPipe(int(uid), int(gid)); err != nil {
|
||||||
return 1, err
|
return 1, err
|
||||||
}
|
}
|
||||||
|
errorFds = []int{stdioPipe[unix.Stdout][0], stdioPipe[unix.Stderr][0]}
|
||||||
// Set stdio to our pipes.
|
// Set stdio to our pipes.
|
||||||
getCreateStdio = func() (*os.File, *os.File, *os.File) {
|
getCreateStdio = func() (*os.File, *os.File, *os.File) {
|
||||||
stdin := os.NewFile(uintptr(stdioPipe[unix.Stdin][0]), "/dev/stdin")
|
stdin := os.NewFile(uintptr(stdioPipe[unix.Stdin][0]), "/dev/stdin")
|
||||||
@ -1056,7 +1077,7 @@ func runUsingRuntime(options RunOptions, configureNetwork bool, configureNetwork
|
|||||||
// Actually create the container.
|
// Actually create the container.
|
||||||
err = create.Run()
|
err = create.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 1, errors.Wrapf(err, "error creating container for %v: %s", spec.Process.Args, runCollectOutput(stdioPipe[unix.Stdout][0], stdioPipe[unix.Stderr][0]))
|
return 1, errors.Wrapf(err, "error creating container for %v: %s", spec.Process.Args, runCollectOutput(errorFds...))
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
err2 := del.Run()
|
err2 := del.Run()
|
||||||
|
Reference in New Issue
Block a user