mirror of
https://github.com/containers/podman.git
synced 2025-12-05 21:32:22 +08:00
Vendor in buildah 1.9.2
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
27
vendor/github.com/containers/buildah/imagebuildah/util.go
generated
vendored
27
vendor/github.com/containers/buildah/imagebuildah/util.go
generated
vendored
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/containers/buildah"
|
||||
"github.com/containers/storage/pkg/chrootarchive"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -105,21 +106,23 @@ func TempDirForURL(dir, prefix, url string) (name string, subdir string, err err
|
||||
return "", "", errors.Errorf("unreachable code reached")
|
||||
}
|
||||
|
||||
func dedupeStringSlice(slice []string) []string {
|
||||
done := make([]string, 0, len(slice))
|
||||
m := make(map[string]struct{})
|
||||
for _, s := range slice {
|
||||
if _, present := m[s]; !present {
|
||||
m[s] = struct{}{}
|
||||
done = append(done, s)
|
||||
}
|
||||
}
|
||||
return done
|
||||
}
|
||||
|
||||
// InitReexec is a wrapper for buildah.InitReexec(). It should be called at
|
||||
// the start of main(), and if it returns true, main() should return
|
||||
// immediately.
|
||||
func InitReexec() bool {
|
||||
return buildah.InitReexec()
|
||||
}
|
||||
|
||||
func convertMounts(mounts []Mount) []specs.Mount {
|
||||
specmounts := []specs.Mount{}
|
||||
for _, m := range mounts {
|
||||
s := specs.Mount{
|
||||
Destination: m.Destination,
|
||||
Type: m.Type,
|
||||
Source: m.Source,
|
||||
Options: m.Options,
|
||||
}
|
||||
specmounts = append(specmounts, s)
|
||||
}
|
||||
return specmounts
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user