mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
Vendor in containers/buildah 1.16.1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
15
vendor/github.com/containers/buildah/run_linux.go
generated
vendored
15
vendor/github.com/containers/buildah/run_linux.go
generated
vendored
@@ -316,7 +316,7 @@ func addCommonOptsToSpec(commonOpts *CommonBuildOptions, g *generate.Generator)
|
||||
return nil
|
||||
}
|
||||
|
||||
func runSetupBuiltinVolumes(mountLabel, mountPoint, containerDir string, copyWithTar func(srcPath, dstPath string) error, builtinVolumes []string, rootUID, rootGID int) ([]specs.Mount, error) {
|
||||
func runSetupBuiltinVolumes(mountLabel, mountPoint, containerDir string, builtinVolumes []string, rootUID, rootGID int) ([]specs.Mount, error) {
|
||||
var mounts []specs.Mount
|
||||
hostOwner := idtools.IDPair{UID: rootUID, GID: rootGID}
|
||||
// Add temporary copies of the contents of volume locations at the
|
||||
@@ -359,7 +359,7 @@ func runSetupBuiltinVolumes(mountLabel, mountPoint, containerDir string, copyWit
|
||||
if err = os.Chown(volumePath, int(stat.Sys().(*syscall.Stat_t).Uid), int(stat.Sys().(*syscall.Stat_t).Gid)); err != nil {
|
||||
return nil, errors.Wrapf(err, "error chowning directory %q for volume %q", volumePath, volume)
|
||||
}
|
||||
if err = copyWithTar(srcPath, volumePath); err != nil && !os.IsNotExist(errors.Cause(err)) {
|
||||
if err = extractWithTar(mountPoint, srcPath, volumePath); err != nil && !os.IsNotExist(errors.Cause(err)) {
|
||||
return nil, errors.Wrapf(err, "error populating directory %q for volume %q using contents of %q", volumePath, volume, srcPath)
|
||||
}
|
||||
}
|
||||
@@ -483,8 +483,7 @@ func (b *Builder) setupMounts(mountPoint string, spec *specs.Spec, bundlePath st
|
||||
|
||||
// Add temporary copies of the contents of volume locations at the
|
||||
// volume locations, unless we already have something there.
|
||||
copyWithTar := b.copyWithTar(nil, nil, nil, false)
|
||||
builtins, err := runSetupBuiltinVolumes(b.MountLabel, mountPoint, cdir, copyWithTar, builtinVolumes, int(rootUID), int(rootGID))
|
||||
builtins, err := runSetupBuiltinVolumes(b.MountLabel, mountPoint, cdir, builtinVolumes, int(rootUID), int(rootGID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -864,12 +863,12 @@ func runUsingRuntime(isolation Isolation, options RunOptions, configureNetwork b
|
||||
stat := exec.Command(runtime, args...)
|
||||
stat.Dir = bundlePath
|
||||
stat.Stderr = os.Stderr
|
||||
stateOutput, stateErr := stat.Output()
|
||||
if stateErr != nil {
|
||||
return 1, errors.Wrapf(stateErr, "error reading container state")
|
||||
stateOutput, err := stat.Output()
|
||||
if err != nil {
|
||||
return 1, errors.Wrapf(err, "error reading container state (got output: %q)", string(stateOutput))
|
||||
}
|
||||
if err = json.Unmarshal(stateOutput, &state); err != nil {
|
||||
return 1, errors.Wrapf(stateErr, "error parsing container state %q", string(stateOutput))
|
||||
return 1, errors.Wrapf(err, "error parsing container state %q", string(stateOutput))
|
||||
}
|
||||
switch state.Status {
|
||||
case "running":
|
||||
|
||||
Reference in New Issue
Block a user