mirror of
https://github.com/containers/podman.git
synced 2025-11-30 10:07:33 +08:00
Vendor in containers/(buildah, common)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/buildah/bind/mount.go
generated
vendored
8
vendor/github.com/containers/buildah/bind/mount.go
generated
vendored
@@ -11,11 +11,11 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/containers/buildah/util"
|
||||
cutil "github.com/containers/common/pkg/util"
|
||||
"github.com/containers/storage/pkg/idtools"
|
||||
"github.com/containers/storage/pkg/mount"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/exp/slices"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
@@ -192,11 +192,11 @@ func SetupIntermediateMountNamespace(spec *specs.Spec, bundlePath string) (unmou
|
||||
// Decide if the mount should not be redirected to an intermediate location first.
|
||||
func leaveBindMountAlone(mount specs.Mount) bool {
|
||||
// If we know we shouldn't do a redirection for this mount, skip it.
|
||||
if cutil.StringInSlice(NoBindOption, mount.Options) {
|
||||
if slices.Contains(mount.Options, NoBindOption) {
|
||||
return true
|
||||
}
|
||||
// If we're not bind mounting it in, we don't need to do anything for it.
|
||||
if mount.Type != "bind" && !cutil.StringInSlice("bind", mount.Options) && !cutil.StringInSlice("rbind", mount.Options) {
|
||||
if mount.Type != "bind" && !slices.Contains(mount.Options, "bind") && !slices.Contains(mount.Options, "rbind") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -294,7 +294,7 @@ func UnmountMountpoints(mountpoint string, mountpointsToRemove []string) error {
|
||||
}
|
||||
}
|
||||
// if we're also supposed to remove this thing, do that, too
|
||||
if cutil.StringInSlice(mount.Mountpoint, mountpointsToRemove) {
|
||||
if slices.Contains(mountpointsToRemove, mount.Mountpoint) {
|
||||
if err := os.Remove(mount.Mountpoint); err != nil {
|
||||
return fmt.Errorf("removing %q: %w", mount.Mountpoint, err)
|
||||
}
|
||||
|
||||
4
vendor/github.com/containers/buildah/bind/util.go
generated
vendored
4
vendor/github.com/containers/buildah/bind/util.go
generated
vendored
@@ -1,8 +1,8 @@
|
||||
package bind
|
||||
|
||||
import (
|
||||
"github.com/containers/common/pkg/util"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -14,7 +14,7 @@ const (
|
||||
|
||||
func stripNoBindOption(spec *specs.Spec) {
|
||||
for i := range spec.Mounts {
|
||||
if util.StringInSlice(NoBindOption, spec.Mounts[i].Options) {
|
||||
if slices.Contains(spec.Mounts[i].Options, NoBindOption) {
|
||||
prunedOptions := make([]string, 0, len(spec.Mounts[i].Options))
|
||||
for _, option := range spec.Mounts[i].Options {
|
||||
if option != NoBindOption {
|
||||
|
||||
Reference in New Issue
Block a user